Event target
In this chapter you will learn:
Event target
<html><!--from java2 s . c o m-->
<head>
<script src="http://java2s.com/style/jquery-1.8.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#container").click(function (e) {
alert(e.target.tagName);
e.preventDefault();
return false;
});
});
</script>
</head>
<body>
<body>
<div id="container">
<div>
<p>This <span>is the <em>way</em> we</span>
write <em>the</em> demo,</p>
</div>
</div>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
- Syntax for bind method
- How to bind the same action twice
- How to bind double click event
- How to bind mouse enter/leave event