<!DOCTYPE html>生日 (年和月): type="month" id="myMonth" name="bdaymonth"点击按钮显示或者修改month 字段的 name 属性值。onclick="display()"显示名称onclick="change()"修改名称function display() {var x = document.getElementById("myMonth").name;alert("month 字段的名称为: " + x);}function change() {var x = document.getElementById("myMonth").name = "newMonthName";alert (" 名称修改为: " + x);}