I'm trying to parse some poorly formatted XML.
I say poorly formatted - because everyone knows that you're not supposed to have un-escaped ampersands in an XML file.
Problem is, I need to collect some unicode formatted phrases from an XML file. I need the format to be as close to the original as possible. You can replicate this issue in your console log...
// Outputs 'â' instead of desired 'â'
new Option(yourUnescapedXml).innerHTML. So to answer your question directly,
This creates an HTMLOptionElement, then immediately gets its (escaped) innerHtml.