Answer the question
In order to leave comments, you need to log in
How is it guaranteed to comment out any piece of HTML?
Good afternoon habra community!
An interesting, and as it turned out, non-trivial question arose. It is necessary to insert lines in the html text in such a way that an arbitrary block with any valid content can be commented out.
Option 1. Write naturally:
<!--
тут наш код для отключения
-->
<comment> </comment>
It turned out that it is only supported by IE, so I didn’t even look at how it works. <script type="text/javascript"> /*
тут наш код для отключения
*/ </script>
Answer the question
In order to leave comments, you need to log in
I would
advise
you
to cut the required piece of code and paste it into
another
file with the same name. file.
In the long run, it makes sense to abandon the software system that forces you to face such tasks.
If this option is suitable, then you can add script tags:
<script>
/* разметка */
// или так
</script>
So far I see the only option: jsfiddle.net/6Xr2w/1/
1. Comment inside the script with single-line comments
2. For nested </script> tags, replace brackets with < and >
3. Wrap the script of the first level in <![CDATA[...]]>, for validity =)
friends, how are you?
<?php /*
comment
*/?> the
first options also do not work
with display: none - in general, a risk
<!-- Коммент ВРЕМЕННЫЙ
<! Коммент постоянный 1 >
<div class="a">
<p>Lorem ipsum dolor sit, amet.</p>
</div>
<! Коммент постоянный 2 >
<div class="b">
<p>Lorem ipsum dolor sit amet.</p>
</div>
<! Коммент постоянный N >
<div class="c">
<p>Lorem ipsum dolor sit amet.</p>
</div>
-->
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question