Handle future element event
Description
The following code shows how to handle future element event.
Example
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(function() {<!--from w ww. j a v a2 s. c o m-->
$("body").delegate("p", "click", function() {
document.writeln('ouch');
}).css("color", "green");
});
</script>
</head>
<body>
<p>Hit Me! ja va2s.com</p>
</body>
</html>