Skip to content

Instantly share code, notes, and snippets.

@jakemcgraw
Created July 13, 2010 16:05
Show Gist options
  • Save jakemcgraw/474096 to your computer and use it in GitHub Desktop.
Save jakemcgraw/474096 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title></title>
<script>
function foo(){
alert(this.tagName || this.nodeName);
};
function bar (element) {
alert(element.tagName || element.nodeName);
}
</script>
</head>
<body>
<div onclick="foo();">
This won't work
</div>
<div onclick="bar(this);">
This will work
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment