Javascript examples for DOM HTML Element:Input Datetime
Input Datetime name Property - Change the name of a datetime field:
<!DOCTYPE html> <html> <body> Birthday: <input type="datetime" id="myDatetime" name="bdaytime"> <button onclick="display()">Display name</button> <button onclick="change()">Change name</button> <script> function display() { var x = document.getElementById("myDatetime").name; console.log("The name of the datetime field is: " + x); } function change() {/*ww w .j av a2s .co m*/ var x = document.getElementById("myDatetime").name = "newDatetimeName"; console.log("The name was changed to: " + x); } </script> </body> </html>