x
 
<!DOCTYPE html>
<html>
<body>
<p>单击该按钮以创建 P 元素。</p>
<button onclick="myFunction()">试一试</button>
<script>
function myFunction() {
  var x = document.createElement("P");
  var t = document.createTextNode("This is a paragraph.");
  x.appendChild(t);
  document.body.appendChild(x);
}
</script>
</body>
</html>