Home  >  Article  >  Web Front-end  >  How to hide the a tag in jquery

How to hide the a tag in jquery

藏色散人
藏色散人Original
2020-11-25 11:35:492704browse

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 .

How to hide the a tag in jquery

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:

How to hide the a tag in jquery

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn