Prosty przykład użycia event listenerów
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Event handlers demo</title> | |
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<div class="wrapper" style="width:300px;height:300px;background:red;"> | |
<button>Click me</button> | |
</div> | |
<script> | |
(function() { | |
$('.wrapper').click(function wrapperHandler() { | |
console.log('wrapper'); | |
}); | |
$('button').click(function buttonHandler() { | |
console.log('button'); | |
}); | |
})(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment