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