Reputation: 51
This is my code but it enable the button after refreshing
function disablebtn(){
$("input[type=checkbox]").prop("disabled", true);
$(".buttons11").prop("disabled", true);
return true;
}
Upvotes: 3
Views: 78
Reputation: 5183
You should use HTML5 Web storages for such requirements.
The following code should provide you an idea:
// For after refresh or later navigation to the page
if (localStorage.btnStatus === "disabled") {
disablebtn();
}
function disablebtn() {
$("input[type=checkbox]").prop("disabled", true);
$(".buttons11").prop("disabled", true);
localStorage.btnStatus = "disabled";
return true;
}
Upvotes: 2