Skip to content

Instantly share code, notes, and snippets.

@tomfuertes
Created July 17, 2017 18:38
Show Gist options
  • Save tomfuertes/c3d8ed27f9f63fbc103196224b450cd4 to your computer and use it in GitHub Desktop.
Save tomfuertes/c3d8ed27f9f63fbc103196224b450cd4 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Custom click handler -->
<script>
window.myHandler = function() {
console.log('Click!');
};
</script>
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script>
$(function () {
window.myHandler = function () {
console.log('I taught myself HTML in 1996 when I was 11 years old')
}
})
</script>
</head>
<body>
<!--<script src="https://slow.com/takes-2-seconds-to-load.js"></script> -->
<div id="myDiv">OMG Click me!</div>
<script>
$('#myDiv').click(myHandler);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment