开发者

How to use jQuery to find a link within the div with a certain class and make it inactive

How开发者_开发知识库 to use jQuery to find a link within the div with a certain class and make it inactive, that is to deprive the property links to her it was impossible to push.


$("div.someClass").find("a").removeAttr("href");

or if you would rather not get rid of the href attribute:

$("div.someClass a").click(function(e) {
    e.preventDefault();
});


Like this:

$("div.classToFind a").click(function() { return false; });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜