title: how to check if a tag exists using javascript without getting an error
body: <p>I have xml data with root "clients" and it can contains multiple elements of "client" inside it. sometimes there are no client elements that are returned in the XML file (this is ok). I need to determine if there are any client elements returned so i tried using:</p>
  
  <pre><code>if(typeof myfile.getElementsByTagName("client")){
    alert("no clients");
  }
  </code></pre>
  
  <p>This does the intended job, but I get a firebug error whenever there are no "client" elements. </p>