Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  21] [ 7]  / answers: 1 / hits: 17257  / 15 Years ago, fri, june 5, 2009, 12:00:00

How can I alias the function document.getElementById
I've seen it done using $



Thanks


More From » function

 Answers
35

Possibly the easiest/shortest way:



function $(id) { return document.getElementById(id); };

[#99373] Wednesday, June 3, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alekgermanb

Total Points: 616
Total Questions: 86
Total Answers: 105

Location: Aland Islands
Member since Thu, Dec 23, 2021
2 Years ago
;