This proposal adds the new class AnonymousElement. This
class can be extended to create anonymous custom elements.
class MyAnonymousElement extends AnonymousElement {
connectedCallback() {
this.textContent = 'I am anonymous'
}
}
document.body.appendChild(new MyAnonymousElement())AnonymousElement extends HTMLElement and inherits all properties not mentioned in this proposal.
Readonly property containing an empty DOMString.
Returns the same value as innerHTML.
WARNING: Do not use in production.
<!doctype html>
<meta charset="utf-8">
<body>
<script src="http://cdn.jsdelivr.net/gh/adrianhelvik/anonymous-custom-elements/polyfill.js"></script>
<script>
class MyAnonymousElement extends AnonymousElement {
connectedCallback() {
this.textContent = 'I am anonymous'
}
}
document.body.appendChild(new MyAnonymousElement())
</script>
</body>Does not alter innerHTML, outerHTML or tagName