This is very useful for javascript devopers that how to get anchor tag href value in jquery, most of the time we use onclick kind of event’s function passing the value through it but now don’t take any kind of risk here, just use only <a> tag href value and get the value if you clicked on it.

Complete example is available in the below.

<title>Jquery find the anchor tag href value example</title>
<script type=”text/javascript” src=””></script>
<script type=”text/javascript”>
$(document).ready(function() {
$(“a”).click(function(event) {
alert(“You have clicked on <a> link”);
var href = $(‘a’).attr(‘href’);
<a href=””></a>

Please share it in SM.


1559 Total Views 2 Views Today

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>