Last active
August 29, 2015 13:56
-
-
Save mzabriskie/8960578 to your computer and use it in GitHub Desktop.
Legacy get element code circa 2001
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
function getElement(id) { | |
var el = null; | |
if (document.getElementById) { | |
el = document.getElementById(id); | |
} | |
else if (document.all) { | |
el = document.all[id]; | |
} | |
else if (document.layers) { | |
el = document.layers[id]; | |
} | |
return el; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment