Created
July 13, 2010 16:05
-
-
Save jakemcgraw/474096 to your computer and use it in GitHub Desktop.
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
<!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