I often use the method
getElementById is very fast and you shouldn't have to worry about performance.
If you are using the same ID over and over (and over and over) again, you might want to cache it. The performance gain is neglectable:
var myId = getElementById("myId"); myId.operation1(); myId.operation2(); myId.andSome5000MoreCalls();
Check this SO answer for some benchmarks. The results Mike posted were:
IE8 getElementById: 0.4844 ms
IE8 id array lookup: 0.0062 ms
Chrome getElementById: 0.0039 ms
Chrome id array lookup: 0.0006 ms
Firefox 3.5 was comparable to chrome.