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

<p>单击按钮可创建一个带有一些文本的 FIELDSET 元素。</p>

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

<script>
function myFunction() {
  var x = document.createElement("FIELDSET");
  var t = document.createTextNode("在此处插入内容 ...");
  x.appendChild(t);
  document.body.appendChild(x);
}
</script>

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