How to remove “href” with Jquery?

后端 未结 4 2117
旧时难觅i
旧时难觅i 2021-01-30 10:26
Qualify

After \"href\" is removed, is \"Qualify\"

4条回答
  •  無奈伤痛
    2021-01-30 11:03

    If you want your anchor to still appear to be clickable:

    $("a").removeAttr("href").css("cursor","pointer");
    

    And if you wanted to remove the href from only anchors with certain attributes (eg ones that just have a hash mark as the href - this can be useful in asp.net)

    $("a[href='#']").removeAttr("href").css("cursor","pointer");
    

提交回复
热议问题