Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.