Javascript examples for DOM HTML Element:Input Date
Disable HTML5 input type date element before today
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from ww w . j a va2s. c o m var today = new Date().toISOString().split('T')[0]; document.getElementsByName("setTodaysDate")[0].setAttribute('min', today); } </script> </head> <body> <input name="setTodaysDate" type="date"> </body> </html>