Comments on HTML | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Comments on HTML

How and when does one use the comment in HTML

10th Jan 2022, 8:34 PM
Ridwan Adebowale
13 Answers
+ 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.
10th Jan 2022, 8:51 PM
Lisa
Lisa - avatar
+ 5
<!-- idk, Wherever a comment seems like a good idea -->
10th Jan 2022, 8:41 PM
CGM
CGM - avatar
+ 2
I use comments to temporarily remove code that is misbehaving and to write <!--TODO-->
11th Jan 2022, 8:35 PM
SAM
SAM - avatar
+ 2
Oh I get now
11th Jan 2022, 10:03 PM
Ridwan Adebowale
+ 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
12th Jan 2022, 9:52 AM
Paul Chirwa
Paul Chirwa - avatar
+ 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.
12th Jan 2022, 5:29 PM
฿₳฿ɎⱠØ₱ɆⱤ 🍼
฿₳฿ɎⱠØ₱ɆⱤ 🍼 - avatar
+ 1
Right, the computer will pretend the comment doesn't exist, but a programmer might need it to understand the code.
10th Jan 2022, 8:52 PM
CGM
CGM - avatar
+ 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.
12th Jan 2022, 5:55 PM
BrokenStar [INACTIVE]
BrokenStar [INACTIVE] - avatar
0
But it doesn’t really affect the state of the code
10th Jan 2022, 8:45 PM
Ridwan Adebowale
0
Alright then Thanks
10th Jan 2022, 8:56 PM
Ridwan Adebowale
0
Misbehaving as how?
11th Jan 2022, 9:59 PM
Ridwan Adebowale
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.
11th Jan 2022, 10:02 PM
SAM
SAM - avatar
0
<!-- -->
23rd Feb 2022, 6:23 PM
Daniel 😊😎😉[JS Challenger]
Daniel 😊😎😉[JS Challenger] - avatar