<!DOCTYPE html>点击按钮创建带有文本的 LEGEND 元素。id="myFieldset"用户名: type="text"onclick="myFunction()"尝试一下function myFunction(){var x = document.createElement("LEGEND");var t = document.createTextNode("Personalia:");x.appendChild(t);document.getElementById("myFieldset").appendChild(x);};