I'm in process of some beginner coding on Javascript/jQuery and stuck with a problem. Long story short:
- I have one element on page which should ignore any clicks;
- Once specific function called it should wait until n clicks;
- Function should execute then some code;
- After all is done element should ignore clicks again.
I tried to play around with setInterval()
/ clearInterval()
but did not succeed.
Please help me :)
P.S.: one way is to reload a page with the new code but it is not for my case.
UPD:
var select = function() {
/*once called this function should enable clicks on <td>
toggling its class to yellow and once both cells are yellow
clicking should be disabled*/
};
$(document).ready(function(){
$("button[name=start]").click(function(){
select();
});
});
http://jsfiddle.net/superiorbanana/Z53EU/. Hope this small bit of code will clarify the idea.