Home Tutorial Jquery Hide hyperlink using jQuery

 
 

Share on Google+Share on Google+
Hide hyperlink using jQuery
Posted on: July 27, 2010 at 12:00 AM
Advertisement
In this tutorial, we will discuss about how to hide hyperlink after clicking it using jQuery.

Hide hyperlink using jQuery

In this tutorial, we will discuss about how to hide hyperlink after clicking it using jQuery. In the below example , a hyperlink "Click here to hide this link" is included in the web page. When we click on it ,it will disappear.

jqHidelink . html

<!DOCTYPE html>
<html>
<head>
<script src="jquery-1.4.2.js" type="text/javascript"></script>
</head>
<body>
<p>This will not appear in the browser</p>
<a href="#">Click here to hide this link</a>
<p>This is another paragraph , which will be hidden</p>
<script>

$("p").hide();
$("a").click(function () {
$(this).hide();
return true;
});
</script>
</body>
</html>

Description of the program:

The below code hide the paragraphs :

$("p").hide();

The given below code is responsible for hiding link after clicking :

$("a").click(function () {
$(this).hide();
return true;
});

OUTPUT :

After click ,it will disappear from browser.

 Download Source Code

 

Click here to see demo

Advertisement

Related Tags for Hide hyperlink using jQuery:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 27, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com