JQuery Hyperlink Click

JQuery Hyperlink Click

JQuery Hyperlink click

Here we will see how to attach click event to hyperlink html element. We can also stop default behavior of hyperlink onClick.

$("a").click( function(e) {    

Above code attaches click event to all hyperlinks present on page. Function preventDefault() stops the default behavior.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<script type="text/javascript" language="javascript">


        $("a").click( function(e) {    

HTML Source.
           <a href="http://www.satalaj.com">www. satalaj .com</a>
           <a href="http://www.jquery.com"> www. jquery .com </a>
           <a href="http://revenmerchantservices.com"> reven merchant services .com</a>

Where to go from here?

Learn how to track user activities on page.

Track user activities on page.


How To Hide Div On Click Using JQueryBasics of jqueryJQuery SlideLearning JqueryJQuery Change Div background Color and Text Color On ClickJQuery On Click Change Div ContentJquery Mouse Click PositionJquery image click eventJquery button click eventJquery Trim StringJQuery Animate Div Height and Width


My name is Satalaj, but people call me Sat. Here is my homepage: . I live in Pune, PN and work as a Software Engineer. I'm former MVP in ASP.net year 2010.
Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer. You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content to other web sites. Feel free to copy or extend the code.
If you want to fight with me, this website is not for you.

I'm Satalaj.