title: How do I detect if a object has a certain property or not?
body: <p>I am trying to find a cross browser compatible way to find if a object has a certain property or not.</p>
  
  <pre><code>Eg. span
  
  var elem = document.getElementById('span1');
  
  if(elem.hasOwnProperty('title'))
  {
  }
  </code></pre>
  
  <p>this works in IE9 but throws nasty errors on IE8 and whole site is brought down just by this line. Is there any browser compatible way to find if object has certain property or not?</p>