0
<body>
1
<br/>
2
<br/>
<!--3-->
<br/>
4
</body>

In this example I want to ignore all the code from 1 to 4 as I did with 3 without removing 3 ignore tag.

kaya3
  • 47,440
  • 4
  • 68
  • 97
Uri Haramati
  • 56
  • 1
  • 5

1 Answers1

-2

The browser parses every <!-- as start of a comment and --> as its end. If you have comment inside another comment, like:

<!-- a
<!-- b -->
-->

the browser will parse:

<!-- a
<!-- b -->

as comment and print the --> because he thinks the <!-- a... is closed with b -->.

You need to close the comment tag before the next comment and open again afterwards

Michael Sazonov
  • 1,531
  • 11
  • 21