title: jquery: test whether input variable is dom element
body: <p>I would like to write a jquery function that accepts either a dom element or its id as input:</p>
  
  <pre><code>function myfunction(myinput){
   // pseudocode:
   // if (myinput is dom element){
   //   var myID = $(myinput).attr('id');
   // } else {
   //   var myID = myinput;
   // }
  
   // Do stuff with myID ...
  
  }
  </code></pre>
  
  <p>Question:  How can I tell whether myinput is a dom element???</p>