jquery將a標(biāo)簽隱藏的方法:首先創(chuàng)建一個示例文件;然后定義一個a標(biāo)簽;最后通過“$(selector).hide(speed,easing,callback)”方法將a標(biāo)簽隱藏即可。
推薦:《jquery教程》
-
該方法適用于任何品牌的電腦。
jquery中可以使用hide()方法隱藏a標(biāo)簽,hide()方法隱藏被選元素,與CSS屬性display:none類似。
語法:
$(selector).hide(speed,easing,callback)
參數(shù):
示例:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)</title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $(".btn1").click(function(){ $("a").hide(); }); $(".btn2").click(function(){ $("a").show(); }); }); </script> </head> <body> <a href="https://www.php.cn/">php中文網(wǎng)</a> <button class="btn1">隱藏</button> <button class="btn2">顯示</button> </body> </html>