I want to replace a tag using .innerHTML
.
It looks like this:
var foo = document.getElementsByTagName("Foo");
for(var i = 0; i < foo.length; i++) {
foo[i].innerHTML = "<Bar>Lorem ipsum</Bar>";
}
However, since .innetHTML
returns case-insensitive on Firefox and it's not consistant across web browers. I got
<bar>lorm ipsum</bar>
What should I do to get case-sensitive return? (Without using jQuery or too-complex code).
I have searched and found this, and this, but those are 9 and 5 years old and not really answer what I need. So I think it'd be ok to ask this question again.
Thanks in advance!