I often write comments like this
<div id="wrapper">
...
</div> <!-- id="wrapper" -->
But what if I wrote them like this?
<div id="wrapper">
...
</div id="wrapper">
At first it seems dangerous to put an id attribute that has the same value on another tag, but then, doesn't the browser throw out that information? As far as I can see Chrome and Firefox both disregard any "attributes" in the closing tag.
Also seems unfortunate that it's not a real comment. It wont be parsed semantically as a comment. But I don't think anyone is using that space for anything else, right? Closing tags only close, right?
Is there any reason not to do this other than it's not a standard?
if (A) oneLiner(); else if (B) oneLiner(); else oneLiner();Is that a if else with another if else in else clause or an if/else if/else? It will probably be interpretted correctly, but you don't leave these things to chance.<!-- /wrapper -->to mark the end of the "wrapper" section, for example. Obviously / has no special significance in the comment, but it is short and easy to understand.