The bro...">

Get the original (case sensitive) HTML code with JS / jQuery

Somewhere inside the original HTML text file:

<sPaN id="test"></sPaN>

The browser looks like this:

<sPaN id="test"></sPaN>

How can I get the original html with saved cases?

test['innerHTML'] //returns lower case.

Edit:

For those who are interested: I use Highlighter syntax to demonstrate some XML on the page. And XML is a case-sensitive language - so it is important that demo XML has an original case.

Highlighter syntax outputs text using the ['innerHTML'] property, which returns lowercase tags. so i need to fix the syntax brightness.

+2
source share
1 answer

HTML/XML , .

. HTML- :

<textarea id="my-xml">
   <Example>
      <Node>Text</Node>
   </Example>
</textarea>

javascript/jQuery:

var myxml = $('#myxml-xml').val(); //my will have case sensitive XML
0

Source: https://habr.com/ru/post/1653914/


All Articles