While I’m on a XUL bint… here’s how to implement innerHTML in XUL. Invaluable for debugging:

1
2
3
4
Object.prototype.xulInnerHTML = function()
{
  return (new XMLSerializer()).serializeToString(this);
};

Usage:

1
2
var myElement = document.getElementById("myID");
alert(myElement.xulInnerHTML);

EDIT: I’ve since learned that extending the built-into JS objects in this manner is NOT recommended. Instead you should implement this function as a procedural function instead. Just a heads up.