0 points

javascript - Disable submit button between two time period - Stack Overflow


dashboard

Wed May 20 2020 16:17:45 GMT+0000 (UTC)

Posted by @hasnaindev

<script>
 window.addEventListener("load", function(){
 var currentTime = new Date();
 var hours = currentTime.getHours();
 var minutes = currentTime.getMinutes();
 var t =currentTime.getHours()  + ":" + currentTime.getMinutes();

 var newButton = document.getElementById("submit");

 if(t >= 10:25 && t <= 11:25) {
   newButton.style.display = "none";
 }
 else {
   newButton.style.display = "block";
 }
 }, false);
</script>
content_copy
https://stackoverflow.com/questions/47216001/disable-submit-button-between-two-time-period

>> Browse more code snippets

more_vert