JavaScript Reference/Javascript Methods/appendData
Версия от 18:30, 25 мая 2010; (обсуждение)
"appendData()" Example
<html>
<body>
<p id="myP" class="explanations">Sample text.</p>
<script language="JavaScript">
function function1(){
var m = myP.firstChild.appendData(" This is the added string.");
}
</script>
<input type="button" onClick="function1();" value="Append data">
</body>
</html>
"appendData()" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |<comment> TextNode |
+----------------+--------------------------------------------------------------+
"appendData()" Syntax, Parameters and Note
Note:
Appends a character string to the end.
Syntax:
textNodeName.appendData(param1) // IE only
document.getElementById("commentID").appendData(param1)
document.all.rumentID.appendData(param1) // IE only
Parameters:
param1 Required; the new character string.