Home > Article > Web Front-end > How to hide the a tag in jquery
How to hide the a tag in jquery: first create a sample file; then define an a tag; finally hide the a tag through the "$(selector).hide(speed, easing, callback)" method .
The operating environment of this tutorial: Windows 7 system, jquery version 1.10.2. This method is suitable for all brands of computers.
Recommended: "jquery tutorial"
In jquery, you can use the hide() method to hide the a tag, the hide() method to hide the selected element, and the CSS attribute display: none is similar.
Syntax:
$(selector).hide(speed,easing,callback)
Parameters:
Example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文网</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中文网</a> <button class="btn1">隐藏</button> <button class="btn2">显示</button> </body> </html>
The above is the detailed content of How to hide the a tag in jquery. For more information, please follow other related articles on the PHP Chinese website!