Internet Explorer 6, Part I: DOM Standards Support: Appending DOM strings - Doc JavaScript | WebReference

Internet Explorer 6, Part I: DOM Standards Support: Appending DOM strings - Doc JavaScript


Internet Explorer 6, Part I: DOM Standards Support

Appending DOM strings

Internet Explorer 6 supports the appendData() method. Operating on text nodes, it appends a string to the text node data. Here is its syntax:

textObj.appendData(data);

where:

Let's create a text node at the document level. We put the following line in the header of this page:

txtObj = document.createTextNode("Doc JavaScript");

and then let's append the string " Tip of the Day" to it:

Here is the definition of this button:

<FORM>
<INPUT TYPE="button" VALUE="Append a String"
  onClick="javascript:handleClick()">
</FORM>

and here is the function handleClick() we put in the header of this page:

function handleClick() {
  txtObj.appendData(" Tip of the Day");
  alert(txtObj.data);
}

Next: How to use the document object

http://www.internet.com


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: July 16, 2001
Revised: July 16, 2001

URL: http://www.webreference.com/js/column88/6.html