Last active
June 13, 2017 19:26
-
-
Save Bajena/ca4189c7f9bd4667d7c6927b9baaf7c9 to your computer and use it in GitHub Desktop.
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