+ 2
Comments on HTML
How and when does one use the comment in HTML
14 odpowiedzi
+ 6
Yes, that is what a comment is supposed to do: It doesn't affect the execution of the code. It describes parts of code.
+ 5
<!-- idk, Wherever a comment seems like a good idea -->
+ 2
I use comments to temporarily remove code that is misbehaving and to write <!--TODO-->
+ 2
Oh
I get now
+ 2
This is how
<! -- the comment goes here -->
We use comments to help the other programmers who are checking your codes know what the code does or where it refers
+ 2
I think comments depends on you the user. It solves many problems when you feel like using it, like someone else viewing your code, for better understanding. And also to set temporary values.
+ 1
Right, the computer will pretend the comment doesn't exist, but a programmer might need it to understand the code.
+ 1
You can basically put it wherever you need like if you need to put a note next to a line of code or section off different parts of your code. I use it a lot to make code areas that I need to clean up or areas where I want to change the elements in.
0
But it doesn’t really affect the state of the code
0
Alright then
Thanks
0
Misbehaving as how?
0
Some times, an element isn't responsive, probably because of a bug in the code, so I comment it out and debug it later... Mostly it's spelling mistakes and trivial mistakes that would consume a lot of time identifying.
0
<!--
-->