Found a number of useful articles on Dustin’s site, which is dedicated to web usability and accessibility. Dustin works for Google (and previously for Yahoo!) and is a published author on the subject, so he is probably worth a read. :)
An older article of his shows a nice implementation of the dollar function $()
, which is typically used in many libraries (including the ASP.NET AJAX client libraries) as a shortcut for document.getElementById()
. Dustin’s implementation handles multiple arguments, and can accept string IDs and object references.