Skip to content

Instantly share code, notes, and snippets.

@Bajena
Last active June 13, 2017 19:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Bajena/ca4189c7f9bd4667d7c6927b9baaf7c9 to your computer and use it in GitHub Desktop.
Prosty przykład użycia event listenerów
<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