66
rated 0 times
[
68]
[
2]
/ answers: 1 / hits: 20313
/ 13 Years ago, tue, february 21, 2012, 12:00:00
I have a link. When some one clicks on that I want to check some conditions before letting it work. If it's false
the default action should be prevented.
$(.pager-next a.active).click(function(event) {
if (!a == 1) {
event.preventDefault();
}
});
The link should only work if a
is equal to 1
. Is the above code correct. a
is set to 1
if a particular condition is met. The link should only work if the condition is met.
More From » jquery