JavaScript: distinguish DOM element objects and Event objects
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object">Javascript isDOM &mdash; How do you check if a Javascript Object is a DOM Object?</a>  </p>
</blockquote>



<p>I have the following simple function:</p>

<pre><code>function do_smth(el){

    if(typeof el != 'object'){
        el = this
    }
    var val = $.trim(el.value)

     /**** some code here ****/

}
</code></pre>

<p>Sometimes it is binded to an element as an event</p>

<p>1)</p>

<pre><code>element.onclick = do_smth
</code></pre>

<p>and sometimes it is used the following way</p>

<p>2)</p>

<pre><code>do_smth(element)
</code></pre>

<p>both ways this should work good...</p>

<p>The problem is that I get the <code>el</code> as <code>Event</code> object in the first case, even if there are no arguments passed. 
So <code>typeof el != 'object'</code> does not work as expected. </p>

<p>How can I distinguish DOM element or Event?</p>
