I am trying to find a cross browser compatible way to find if a object has a certain property or not.
Eg. span
var elem = document.getElementById('span1');
if(elem.hasOwnProperty('title'))
{
}
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?