The final (closing) angle bracket in the code below is not interpreted as closing the <input>
element:
<input type='text' name='name' <!-- id='name' -->>
I thought this was a valid way to comment out this attribute but Google Chrome, Firefox and Notepad++ (color coding) all suggest that this is not the way to go.
I used CTRL+Shift+Q in Notepad++ to do this.
Then what is the proper way to comment out this <id>
attribute?
I usually just put _x
at the end of the attribute name. Then the attribute is ignored because it's unknown. So if I wanted to comment out the id
attribute from this element:
<input type="text" name="name" id="name">
I would change it to this:
<input type="text" name="name" id_x="name">
This also has the advantage of being able to search for "_x=
" to find all commented attributes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With