Ask coding questions

← Back to all posts
HTML Comment doubt
Lanna (40)
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?

eankeen (2239)

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 (347)

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

ash15khng (723)

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

Lanna (40)

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

Vandesm14 (2752)

Nothing is wrong with your code.

Please mark this as answered if I helped your problem 👍

Lanna (40)

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