Javascript Reference
Categories: text

javascript text data

@March 15, 2008, 1:22 a.m.
dataFirefox/Netscape/NN 6 IE 5 Chrome/Safari/DOM 1  

Read/Write  

Contains the string of characters in the text node. The value is the same as the nodeValue property value, and there is no reason to favor one property over the other, except perhaps for plain-language syntactic preferences for reading the code.

 
Example
 
document.getElementById("myP").firstSibling.data = "Some new text.";
 
Value

String.

 
Default

Empty string.


Powered by Linode.