Saturday, February 11, 2012

jQuery - Handle event of user clicking on a link

The jQuery html code trigger a alert whenever users click on any link in the page.
jQuery - Handle event of user clicking on a link
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Mobile-Web-App: jQuery</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script>
$(document).ready(function(){
$("a").click(function(event){
alert("Thanks!");
});
});
</script>
</head>
<body>
<a href="http://mobile-web-app.blogspot.com/">http://mobile-web-app.blogspot.com/</a>

</body>
</html>

No comments:

Post a Comment