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