<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
function handlerName(e){
alert(e.data.msg);
}
$(document).ready(function(){
$("p").delegate({msg: "You just clicked me!"}, "click", handlerName)
});
</script>
</head>
<body>
<p>Click me!</p>
</body>
<!-- Mirrored from www.w3schools.com/jquery/tryit.asp?filename=tryjquery_event_delegate_data by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 18:06:17 GMT -->
</html>