You are here: irt.org | FAQ | DHTML | Q148 [ previous next ]
In Internet Explorer 4, the Dynamic Object Model allows you greater control over objects on the page. By identifying portions of the text using the ID attribute in a HTML tag you can directly access that portion of the text using in the innerText property of the required ID:
<SCRIPT LANGUAGE="JavaScript"> function myClick1() { document.all("MyID1").innerText = 'This is the changed paragraph.'; } </SCRIPT> <P ID="MyID1">This is a normal paragraph.</P> <FORM><INPUT TYPE="BUTTON" VALUE="Click Me" onClick="myClick1()"></FORM>