Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Correct construction of commented code block

Status
Not open for further replies.

ChrisRChamberlain

Programmer
Mar 23, 2000
3,392
GB
Hi all

Wish to comment out a block of miscellaneous code containing characters '<' and '>' such as
Code:
<!--
<div class="myclass">Hello World</div>
<span class="anotherclass">Hello again</span>
etc,etc
-->
Is there a better way than what's been posted as an example?

TIA

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Better in what way? As they say: it is what it is.

You could stick it between script tags and use js comments instead, but I don't see any gain in doing it that way.

Code:
<script type="text/javascript">

[red]//[/red][green]<div class="myclass">Hello World</div>[/green]
[red]//[/red][green]<span class="anotherclass">Hello again</span>[/green]

</script>

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top