javascript text data

dataNN 6 IE 5 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.


2058,Nickname,Homepage or email,Comments here,Add comment