?? 例9-2.html
字號:
<html>
<head>
<title>節點及節點接口的應用</title>
</head>
<body>
<H1>添加元素示例</H1>
<xml id="isle" src="EX9_1.XML">
</xml>
<script language="vbscript">
set mydoc=isle
if mydoc.parseError<>0 Then
MsgBox mydoc.parseError.reason
Else
set roote=mydoc.documentElement
set childlist=roote.childNodes
document.write "<p>添加元素前,元素的個數和最后一個元素名稱為:</p>"
document.write "<LI>" &childlist.length & "<BR> "
document.write "<LI>" & roote.lastChild.nodeName & "<BR>"
set newe1=mydoc.createElement("good")
set dummy=roote.appendChild(newe1)
document.write "<p>添加元素后,元素的個數和最后一個元素名稱為:</p>"
document.write "<LI>" & (childlist.length) & "<BR>"
document.write "<LI>" & (roote.lastChild.nodeName) & "<BR>"
End If
</script>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -