Find all links in the div element and disable them all
Suppose I have some HTML elements like these:
<div id="content_div"> <span><a href="some_link">Click me</a></span> <div> Hello everybody. Click <a href="some_link_else">me</a> to do something else</div> <a href="3rd_link"> Oops </a> </div> All I need to do is get all the # # tags in #content_div and disable them all (I don’t want the user to click on them). How can I do this in jQuery?
+4
4 answers
$("#content_div a").css({"color":"#888888", cursor: "default"}).click(function(e){ e.preventDefault(); }); Working example http://jsfiddle.net/P4Fqq/
+1