Microsoft developed innerHTML as a simple way of replacing all the content of an element with new content that might include HTML. The other browsers copied this and so this is a simple way of replacing the content of an HTML element with new content that may include other HTML elements. This is specific to HTML and does not work with XHTML.
One final thing to watch for here is that whether the page is HTML or XHTML is not determined by anything in the actual page itself. The determining factor is the media type specified in the header. This header is set either in the way that your hosting is configured or is added by server side scripting, there is nothing you can put in the page itself to set it. HTML pages are those which have the media type set to text/html while XHTML pages have the media type set to application/xml+xhtml. Perhaps the easiest way of telling which of these media types is the one set for a specific web page is to attempt to view the page in Internet Explorer. None of the versions of Internet Explorer so far released (including version 8) can recognise an XHTML page and will therefore offer it for download instead of displaying it in the browser. All other browsers can recognise both HTML and XHTML and will display the page in the browser.
This article written by Stephen Chapman, Felgall Pty Ltd.