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