Home | Mirror | Search

2. DOMDocument

2.1. createTextNode



<SCRIPT>
function fnChangeNode(){
   var oTextNode = document.createTextNode("文本節點已創建");
   var oReplaceNode = oSpan.childNodes(0);
   oReplaceNode.replaceNode(oTextNode);
}
</SCRIPT>

<span ID="oSpan" onclick="fnChangeNode()">
點擊此處
</span>

comments powered by Disqus