If I have a code like the following;
if (x == "0")
{
$("input:checkbox").parent().mouseover(function () {
//Some code
}
}
My question is will the code get executed on each mouseover OR it will first check the x == "0" condition and then fire ?
In other words, is the $("input:checkbox").parent().mouseover() code similar to what one would get with a bind() or live() function (which gets fired every time on that event) and the enclosing condition of "x" won’t matter ?
Is there any way by which we can link the event with the "x" condition like limiting it’s scope only if x is true?
I am not really sure if my question is really valid. But it would be really great if you could clarify.
It’ll get executed on each mouseover, if x == “0” at the point you have written this code.
If you want to only execute a piece of code if x == “0”, try