代码示例:(标识:htmldom_small_create)
<!DOCTYPE html>
<html>
<body>

<p>单击该按钮以创建带有一些文本的 SMALL 元素。</p>

<button onclick="myFunction()">试一试</button>

<script>
function myFunction() {
  var x = document.createElement("SMALL");
  var t = document.createTextNode("Some small text");
  x.appendChild(t);
  document.body.appendChild(x);
}
</script>

</body>
</html>
运行结果: