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
  • 41,043
  • 4
  • 50
  • 79
Uri Haramati
  • 56
  • 1
  • 5
  • This question doesn't make any sense. What are you asking? HTML doesn't support nested comments. Is that what you're asking? – Cody Gray May 08 '12 at 09:25

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
  • 9
  • 20