[Solved] how do i enable a link for 2hours and it automatically disabled after a time? [closed]


You can use setTimeout function and run a function to disable the function Like

$(document).ready(function(){
     function btn_disable() {
         $("#btn-id").attr('disabled','disabled'); // #btn-id need to button id
         alert("Some error message."); // you can code here to set error message
     }
     setTimeout(btn_disable,3000);// here 3000 means 3 seconds so please calculate for hour
});

You can check it out like that. I just hard coded here so please take extra care of misspelling

solved how do i enable a link for 2hours and it automatically disabled after a time? [closed]