Skip to content

Instantly share code, notes, and snippets.

@TheRealJAG
Last active May 17, 2016 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheRealJAG/8f8e61d8ad38083832ee86f705788830 to your computer and use it in GitHub Desktop.
Save TheRealJAG/8f8e61d8ad38083832ee86f705788830 to your computer and use it in GitHub Desktop.
<script src="https://code.jquery.com/jquery-1.11.0.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function() {
//To gain acccess to DOM, place the function inside $(document).ready
registerClickHandler();
function registerClickHandler() {
$('#clickme').click(function(event) {
var data = $(this).html();
setTimeout(function() {
alert(data);
}, 200,data);
});
}
});
-->
</script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test page</title>
</head>
<body>
<div id="clickme"><strong>test</strong></a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment