So i have this small code snippet and i'm trying to figure out how to get it to work. Basically what it does is when the button is clicked, it becomes disabled. At the same time it runs a timeout function that will re-enable the button after 3 seconds. I can't figure out how to get it to work! Everything else in the button function works fine except for this. I didn't post the entire code cause it's a lot. Variables are all declared and what not.
$("input[type=button]").attr("disabled", "disabled");
var enable_attk = function() {
$("input[type=button]").attr("enabled", "enabled");
enable_timer = setTimeout(enable_attk, 3000);
}
enable_attk();