function checkDate() { var first_1 = document.getElementById('first').value(); var second_2 = document.getElementById('second').value(); if (first_1 > second_2) { alert("введен неправильный промежуток времени "); } else if (first_1 == second_2) { alert("введенные даты одинаковы "); } } <input id="first" type="date"> <input id="second" type="date"> How to check for correctness two values of the input tag, the values of which are dates. The use of third-party frames is not allowed.
...value()- Igor