Created
July 13, 2011 15:30
-
-
Save jeremyckahn/1080531 to your computer and use it in GitHub Desktop.
A good interview question
This file contains hidden or 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></head> | |
| <body> | |
| <button id="mybutton">hello</button> | |
| <div id="output"></div> | |
| <script type="text/javascript" charset="utf-8"> | |
| (function () { | |
| var button, output; | |
| function handler (ev) { | |
| output.innerHTML = 'Hello World!' | |
| output.style.color = '#0f0' | |
| } | |
| button = document.getElementById('mybutton'); | |
| output = document.getElementById('output'); | |
| button.addEventListener('click', handler, false); | |
| } ()); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment