HTML5 input type date is sometimes empty value if entered incorrectly
问题 There is a crazy thing with input type date. Here is my html: function getValue() { $('#entered').text($('input[name=test_date]').val()); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="date" min="2018-01-01" max="2018-05-05" name="test_date"> <button onclick="getValue()">Get value</button> <p>Entered: <span id="entered"></span></p> If I enter an invalid value, it will change to valid value automatically. But not always true. The max