//
createElement() 方法通过指定名称创建一个元素
<!DOCTYPE html>
<html>
<body>
<p id="demo">Click the button to make a BUTTON element with text.</p>
<button οnclick="myFunction()">Try it</button>
<script>
function myFunction()
{
var btn=document.createElement("BUTTON");
var t=document.createTextNode("CLICK ME");
btn.appendChild(t);
document.body.appendChild(btn);
};
</script>
</body>
</html>