<html>
<body>
<form>
<fieldset id="myFieldset">
<legend>个人信息:</legend>
姓名:<input type="text"><br>
电邮:<input type="text"><br>
生日:<input type="text">
</fieldset>
</form>
<p>单击该按钮可显示字段集是哪种类型的表单元素。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myFieldset").type;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>