以下为引用的内容:<input type="button" onclick="appendnode()" value="添加节点"><input type="button" onclick="removenode()" value="删除节点"><div id="result"></div><script>i=0function appendnode() {o=document.createElement("DIV");o.innerHTML="test"+idocument.getElementById('result').appendChild(o);i++}
www phperz com
function removenode(){var x = document.getElementById('result');x.removeChild(x.lastChild) //从最后个节点删除}</script>
PHP程序员站