JavaScript Reference/Javascript Objects/TextNode — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:22, 26 мая 2010
Содержание
"TextNode" Example
<html>
<head>
<script>
function replaceText(){
var myTextNode = document.createTextNode("Text was replaced");
var newTN = replaceMe.firstChild.replaceNode(myTextNode);
}
</script>
</head>
<p id="replaceMe">This is some text that will be replaced</p>
<button onclick="replaceText();">Replace text</button>
</body>
</html>
"TextNode" JavaScript Methods
+----------------+--------------------------------------------------------------+
| JavaScript |appendData deleteData |
| Methods |insertData replaceData |
| |splitText substringData |
+----------------+--------------------------------------------------------------+
"TextNode" JavaScript Properties
+----------------+--------------------------------------------------------------+
| JavaScript |data length |
| Properties |nextSibling nodeName |
| |nodeType nodeValue |
| |parentNode previousSibling |
+----------------+--------------------------------------------------------------+
"TextNode" Syntax and Note
Note:
Access to a text node created using the createTextNode() method.
Syntax:
textNodeName = document.createTextNode("value")
textNodeName.memberName