|
firefox dosent support .outerHTML . Here is a sample code that would get you the outerHTML in firefox
outerHTML is not a valid W3C dom property so is not supported by
firefox. firefox does support innerHTML even though its not a standard.
you should be using W3C properties like nodeValue (for innerHTML). you
can use the document.createNode() to clone the outernode (be sure to
copy attributes)
here is a working sample code for the same.
some times you need to get outerhtml of an element . ,outerHTML is suppoeted in IE not in firefox this is how you do it.
function getOuterHTML(object) {
var element;
if (!object) return null;
element = document.createElement("div");
element.appendChild(object.cloneNode(true));
return element.innerHTML;
}
|