Ask coding questions

← Back to all posts
HTML Comment doubt
Lanna (32)


So am I doing anything wrong in this commenting? 'Cause it ain't working, the comment is not supposed to be displayed but it is, why?

Commentshotnewtop
eankeen (679)

According to the WHATWG html spec, you seem to be commenting properly. It doesn't seem to explicitly say that Comment nodes (which is what you're actually creating when you write comments) cannot be adjacent to Element nodes. I've tried to replicate your problems, but I wasn't successful. Maybe you have some sort of repl?

heyitsmarcus (287)

Can you post it into a Repl? I'm inclined to agree with Vandesm14, just based on what I see here.

ash15khng (393)

Are your tags showing? Like the <html> <head> things?

Lanna (32)

I'm really sorry, I'll just try this out on a repl and post it out. Thanks.

Vandesm14 (703)

Nothing is wrong with your code.

Please mark this as answered if I helped your problem 👍

Lanna (32)

@Vandesm14 No I just updated my one, so that is the question I was actually meaning to ask.