Posted By

ezerick on 06/17/08


Tagged

javascript object id


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

SpinZ
joomla
jserpa
jamesming
guo3823538


Return Object By ID


 / Published in: JavaScript
 

  1. function returnObjById( id )
  2. {
  3. if (document.getElementById)
  4. var returnVar = document.getElementById(id);
  5. else if (document.all)
  6. var returnVar = document.all[id];
  7. else if (document.layers)
  8. var returnVar = document.layers[id]; return returnVar;
  9. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: pelier on June 18, 2008

You need to login to post a comment.