?? 21.4 使用dom實現控件的替換.htm
字號:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>標題頁</title>
<script type="text/javascript">
function test()
{
var mydom1=document.getElementById("divlist1");//獲取指定ID的DOM對象
var mydom2=document.getElementById("divlist2");//獲取指定ID的DOM對象
mydom1.replaceChild(mydom2.firstChild,mydom1.firstChild);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input id="btn1" type="button" value="test" onclick="test()"/>
<div id="divlist1"><p>this is test1</p></div>
<div id="divlist2"><p>this is test2</p></div>
</form>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -