|
Ok here is the javascript function you are looking for. mozilla firefox does not support or donot support outerHTML of outerHTML doesnot
work in firefox.
here is a simple function that will make outerHTML to work.
function outerHTML(node) {
// if IE, Chrome take the internal method otherwise build one
return node.outerHTML || (
function (n) {
var div = document.createElement('div'), h;
div.appendChild(n.cloneNode(true));
h = div.innerHTML;
div = null;
return h;
})(node);
}
the code is pretty simple and redable . any way his is the simple description of how outerHTML would work in mozilla firefox with this
javascript function.
here we creaate an element div using code.
then appends a child node which is the actual node. the idea is to get the code of that element also. and div.innerhtml will give the
value of the complete node we have passed.
i
|