Javascript examples for DOM HTML Element:Input Month
Input Month required Property - Set a month field to be a required part of form submission:
<!DOCTYPE html> <html> <body> <form action="#"> Month: <input type="month" id="myMonth" name="bdaymonth"> <input type="submit"> </form>/*w ww.j ava 2s . co m*/ <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myMonth").required = true; document.getElementById("demo").innerHTML = "required property was set."; } </script> </body> </html>