Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

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:

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);

<P ID="MyID">This is a <B>plain</B> paragraph</P>

<FORM><INPUT TYPE="BUTTON" VALUE="Click Me" onClick="myClick()"></FORM>

©2018 Martin Webb