<html>
<head>
<title>Click Counter</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
// http://kuntoaji.blogspot.com
$(function(){
var total_click = 0;
$("#clickMe").click(function(){
total_click = total_click + 1;
$("#counter").text("Total Click: " + total_click);
return false;
});
});
</script>
</head>
<body>
<div id="counter">Total Click: 0</div><br />
<a id="clickMe" href="#">click me!</a>
</body>
</html>
Sunday, September 11, 2011
Click Counter with jQuery
Summary: Count every user click "click me!" link
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment