jQuery disable a link

前端 未结 17 1363
半阙折子戏
半阙折子戏 2020-11-22 14:45

Anyone know how to disable a link in jquery WITHOUT using return false;?

Specifically, what I\'m trying to do is disable the link of an item, performing

17条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 15:21

    You should find you answer here.

    Thanks @Will and @Matt for this elegant solution.

    jQuery('#path .to .your a').each(function(){
        var $t = jQuery(this);
        $t.after($t.text());
        $t.remove();
    });
    

提交回复
热议问题