Element Types
Web Components ⟩ Custom Elements ⟩
MDN ⟩ CSS ⟩ is attribute
Google ⟩ Extending native HTML elements
autonomous custom elements: “all-new” elements, extending the abstract
HTMLElement
class.customized built-in elements: extending built-in elements (such as
<p>
,<a>
,<br>
)
Autonomous
Customized Built-in Elments
The required third parameter {extends: p} tells the browser which tag you're extending. This is necessary because many HTML tags share the same DOM interface.
<section>, <address>, and <em> (among others) all share HTMLElement.
both <q> and <blockquote> share HTMLQuoteElement, etc..
Specifying {extends: 'blockquote'} lets the browser know you're creating a souped-up <blockquote> instead of a <q>. 📘 Google ⟩ Extending native HTML elements
Last updated