Javascript examples for DOM HTML Element:Input Month
Input Month defaultValue Property - Get the default value of a month field:
<!DOCTYPE html> <html> <body> Month and year: <input type="month" id="myMonth" value="1997-11"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*ww w.j a v a2s . c o m*/ var x = document.getElementById("myMonth").defaultValue; document.getElementById("demo").innerHTML = x; } </script> </body> </html>