Javascript examples for DOM HTML Element:Input Datetime
The type property returns the type of form datetime field.
A String, representing the type of form datetime field
The following code shows how to return which type of form element the datetime field is:
<!DOCTYPE html> <html> <body> A datetime field: <input type="datetime" id="myDatetime"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//ww w . j a va2 s . c om var x = document.getElementById("myDatetime").type; document.getElementById("demo").innerHTML = x; } </script> </body> </html>