Posted By

noah on 06/12/07


DOM work robzand utilities

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


accept either an element or an id as a parameter

 / Published in: JavaScript

  1. function f (idOrEl) {
  2. var el = (typeof idOrEl == 'string' ? document.getElementById(idOrEl) : idOrEl);
  3. }

Report this snippet  

You need to login to post a comment.