[Javascript] Replace element with another element on click

Peter Brunone peter at brunone.com
Wed Mar 23 00:43:38 CST 2005


	Well, the nice IE way is to use the outerHTML property and just
gut the whole thing (it's pretty fast, too).

	If that's not an option, you could have both elements at the
same point in your code and alternately set their height and width to
0px (I tried display:none but Netscape 7 doesn't support it).

Cheers,

Peter

-----Original Message-----
From: javascript-bounces at LaTech.edu On Behalf Of judah

I was curious how to replace a element with another element when the 
user clicks a checkbox. If checkbox is enabled then replace element A 
with B (erase A). If checkbox is unchecked then replace element B with A

(erase B).

Best Regards,
Judah






More information about the Javascript mailing list