function showmenu(o) { var parent = document.getElementById("div1"); var ele = document.createElement("p"); var text = document.createTextNode("我是一个p"); ele.appendChild(text); parent.appendChild(ele); }