2 ms·
document.getElementById is generally pretty portable across browsers. And another clever way of doing cross-browser JavaScript is just to use a mature JS libra
by nostrademons 19y ago
document.getElementById is generally pretty portable across browsers.
And another clever way of doing cross-browser JavaScript is just to use a mature JS library like Prototype or JQuery. They all give you byId for free, in the form of the $ function.
- jkush 19y agoI'm with you there - prototype is first class stuff. I wasn't sure if getElementById was supported by Opera or Safari. If it is, it looks like byId() is good way to save some typing.