Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q145 How do I alter the HTML source of a layer in Internet Explorer?

You are here: irt.org | FAQ | DHTML | Q145 [ previous next ]

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>

©2018 Martin Webb