Here is a little JavaScript function that gets an object according to it’s id and it’s cross browser.
/********************************************************************* * Get an object, this function is cross browser * Usage: * var object = get_object(element_id); * @Author Hamid Alipour http://blog.code-head.com/ **/ function get_object(id) { var object = null; if (document.layers) { object = document.layers[id]; } else if (document.all) { object = document.all[id]; } else if (document.getElementById) { object = document.getElementById(id); } return object; } /*********************************************************************/
My name is Hamid Alipour and I'm an indie developer. 
is this better than jQuery selectors?
Comment
Nope, it’s not, I recommend jQuery, this is for circumstances where it must be done this way…
Comment
ok, thanks
Comment
Thanks man, just what I needed.
Comment