Do custom elements require closing tags?
P粉717595985
P粉717595985 2023-10-29 22:40:33
0
1
845

The elements I defined (which don't require content) seem to work just fine without the closing tag. I'm wondering if this is just a quirk of the browser.

What is the verdict? Is it theoretically possible? What if the parser sees the element before it is defined?

P粉717595985
P粉717595985

reply all(1)
P粉387108772

Yes. Custom elements require closing tags. Due to parser reasons, only certain tags in HTML are allowed to self-close.

and:

http://www.w3.org/TR/ html-markup/syntax.html#syntax-elements

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template