Reputation:
I want to disable 'a' tag inside div using jQuery.
The structure is like:
<div id="xyz"><a style="cursor:pointer;" href="abc.php">xxxx</a></div>
On a particular action:
cursor: pointer
property should go awayUpvotes: 1
Views: 2229
Reputation: 4617
You can use prevent the default action of a tag using
$('#xyz a').click(function(event){
event.preventDefault();
});
Upvotes: 0
Reputation: 6147
Hi You can use this css lines
#xyz a{
pointer-events: none;
cursor: default;
}
Upvotes: 1
Reputation: 145368
Here you are:
$("#xyz a").css("cursor", "auto").removeAttr("href");
Upvotes: 3