making an xmlhttp request to the server asp which returns xml string. xml string is loaded to make xmlDocument. Part of the code is below. Some case xmlhttp may fail, that case it returns 'Page cannot be displayed' error. But this error is a valid html. So non IE browsers load this as [object HTMLHtmlElement] and a condition check for documentElement will be always true. var xmlhttpResponseText; if (window.DOMParser) { parser = new DOMParser(); xmlDoc = parser.parseFromString(xmlhttpResponseText, "text/xml"); } else // Internet Explorer { xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = "false"; xmlDoc.loadXML(xmlhttpResponseText); } alert(xmlDoc.documentElement); if(xmlDoc.documentElement){ alert("satisfies even for page cannot be displayed type of error"); } Code (markup): So in Non IE browsers How to differentiate [object HTMLHtmlElement] and [object Element]