I have a image associated with the anchor tag, once the user clicks the image a popup loads. I want to disable this anchor tag.
The html code looks like:
<a href="#" class="openModalLink">
<img style="vertical-align: middle; border: none" width="9%" alt="" id="imgmap" class="zoom" /></a>
I have tried the below codes but doesn’t seem to work
$(".openModalLink").off("click");
$(".openModalLink").attr("disabled", true);
$(".openModalLink").attr("disabled", "disabled");
Thanks for the replies
You could do this
Also refer docs
EDIT:
To enable and disable anchor tag
DEMO
EDIT 2:
As of jquery 1.7
.on()and.off()are preferred over bind and unbind to attach and remove event handlers on elements