Javascript examples for DOM HTML Element:Input Month
The type property returns the type of form element month field.
A String, representing the type of form element the month field is
The following code shows how to return which type of form element the month field is:
<!DOCTYPE html> <html> <body> <input type="month" id="myMonth"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/* www . j av a 2 s. c o m*/ var x = document.getElementById("myMonth").type; document.getElementById("demo").innerHTML = x; } </script> </body> </html>