I am unable to (re)produce a self closing element. Is it impossible?
<img />
<br />
<link />
<meta />
Self closing HTML elements do not require or support a closing tag.
Modern browsers support custom element tags and behavior using document.registerElement.
Try to extend already void HTML element fails.
class HTMLVoidElement extends HTMLBRElement {
}
document.registerElement('x-void', HTMLVoidElement)
document.createElement('x-void') // returns <x-void></x-void>
It makes no difference if the element is in the document HTML and not created programmatically.
<x-void />
<br />