PDA

Click to See Complete Forum and Search --> : [RESOLVED] Dumb Easy Quesion


RobDog888
Sep 29th, 2005, 01:02 PM
Is there a tag in html for commenting code out? Something like the ones for JavaScript.

I searched but didnt find anything.

Thanks

'...
<tr valign="top">
<td style="width: 10px">&nbsp;</td>
<td style="width: 482px;">&nbsp;</td>
<td style="width: 120px;">&nbsp;</td>
</tr>

//--Comment?
<tr valign="top">
<td style="width: 10px">&nbsp;</td>
<td style="width: 482px;">&nbsp;</td>
<td style="width: 120px;">&nbsp;</td>
</tr>--//end commented code

{yak}
Sep 29th, 2005, 01:11 PM
Yeah, html comments look like this:

<!--
this is a comment
-->

RobDog888
Sep 29th, 2005, 01:15 PM
I thought that was for JavaScript only. just tested it and so it is!
Thanks, told you it was an easy dumb question. :D Shows how little web development I do. :lol:

{yak}
Sep 29th, 2005, 01:33 PM
You're welcome. :)
When I get stuck on this vb.net jabber, i'll be needing your expertise, which will probably be the equivilent of how to comment code :p

CornedBee
Sep 30th, 2005, 06:01 AM
The <!-- inside the script tags is merely a trick to hide the JavaScript from browsers that don't understand the script tag (basically none nowadays - even those that can't do JS recognize and ignore the tag), so that the content doesn't get displayed.

Of course, in XHTML this is a bad idea, because the parser may (and often will) throw away comments without forwarding them to the application - so the browser never sees the JS code.