|
Q145 How do I alter the HTML source of a layer in Internet Explorer?
irt.org | Knowledge Base | DHTML | Q145 [ previous next ]
Q145 How do I alter the HTML source of a layer in Internet Explorer?
As you are probably aware, Explorer does not support "layers" as such, however text or HTML grouped
together using DIV, SPAN and ID can be changed.
The innerHTML property allows you to change the HTML source:
<SCRIPT LANGUAGE="JavaScript">
function myClick() {
alert('innerHTML: ' + document.all('MyID').innerHTML);
document.all("MyID").innerHTML = '<FONT COLOR="#FF0000">This<\/FONT> is <B>not<\/B> <I>plain<\/I>';
alert('innerHTML: ' + document.all('MyID').innerHTML);
}
</SCRIPT>
<P ID="MyID">This is a <B>plain</B> paragraph</P>
<FORM><INPUT TYPE="BUTTON" VALUE="Click Me" onClick="myClick()"></FORM> |
|
|
Copyright © 1996-2009 irt.org, All Rights Reserved.