Javascript examples for DOM HTML Element:Input Month
Input Month value Property - Get the month and year 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() {// w ww . ja v a 2 s . co m var x = document.getElementById("myMonth").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>