We would like to know how to handle click event on inner element.
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.4.2.js'></script>
<script type='text/javascript'>
$(window).load(function(){<!--from www .ja v a2 s . com-->
$('.clickable').click(function() {
console.log('Hello');
});
$('a').click(function(event) {
event.stopPropagation();
});
});
</script>
</head>
<body>
<div class="clickable">
some text... <a href="">Link 1</a> <a href="">Link 2</a>
some text...
</div>
</body>
</html>
The code above is rendered as follows: