Since the getElementById() function is new, I wanted another more reliable method to get a reference to an element based on its id.
Since I need to cut down on size, 10-20K for a framework is unacceptable. I just need the JS to fetch an element.
Since the getElementById() function is new, I wanted another more reliable method to get a reference to an element based on its id.
Since I need to cut down on size, 10-20K for a framework is unacceptable. I just need the JS to fetch an element.
getElementById isn't new. It's been around as long as getElementbyTagName, which was already asked about by you.
There's a reliable method that works in all widely supported browsers that isn't new called getElementById()
...
My answer is the same as your previous question http://stackoverflow.com/questions/820369/alternative-to-getelementsbytagname/820399#820399 .
You can use the Sizzle CSS selector engine. Sizzle is the CSS selector engine that powers jQuery.