Thursday, January 17, 2019

How to disable before today date in html 5

In this article i have explain how to disable today before date in html 5 calendar

Step 1-
Add the input filed in your html page

<input type="date" name="mydate">

which has input type date

Step 2-
Now i want disable date before today date . for doing this add following javascript code into your page 

 <script>
        var today = new Date().toISOString().split('T')[0];
        document.getElementsByName("mydate")[0].setAttribute('min', today);
    </script>



No comments:

Post a Comment

Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...