久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      jquery怎么讓超鏈接不可用

      在jquery中,可以利用removeAttr()方法讓超鏈接禁用,該方法能夠刪除元素中的屬性,只要?jiǎng)h除超鏈接元素的“href”屬性即可,語(yǔ)法為“超鏈接元素對(duì)象..removeAttr('href');”。

      jquery怎么讓超鏈接不可用

      本教程操作環(huán)境:windows10系統(tǒng)、jquery3.2.1版本、Dell G3電腦。

      jquery怎么讓超鏈接不可用

      removeAttr() 方法從被選元素移除一個(gè)或多個(gè)屬性。

      語(yǔ)法

      $(selector).removeAttr(attribute)

      attribute 必需。規(guī)定要移除的一個(gè)或多個(gè)屬性。如需移除若干個(gè)屬性,請(qǐng)使用空格分隔屬性名稱。

      去掉a標(biāo)簽中的href屬性

      示例如下:

      <html> <head> <meta charset="utf-8"> <title>123</title> <script src="js/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("a").removeAttr('href'); }); }); </script> </head> <body> <a href="http://www.php.cn">這是一個(gè)鏈接</a> <button>禁用這個(gè)鏈接</button> </body> </html>

      輸出結(jié)果:

      jquery怎么讓超鏈接不可用

      相關(guān)視頻教程推薦:jQuery視頻教程

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)