You are here: irt.org | FAQ | DHTML | Q149 [ previous next ]
The following will also work in Internet Explorer 4 and 5, and also in Netscape Navigator 6:
<script language="JavaScript"><-- function myClick2() { if (document.all) { document.all('MyID2').innerHTML = '<font color="#FF0000">This</font> is <b>not</b> <i>plain</i>'; } else if (document.getElementById) { document.getElementById('MyID2').innerHTML = '<font color="#FF0000">This</font> is <b>not</b> <i>plain</i>'; } } //--></script> <p id="MyID2">This is a <b>plain</b> paragraph</p> <form><input type="button" value="Click Me" onClick="myClick2()"></form>