is
is attribute
The is
global attribute enables a standard HTML element to function as a custom-built element. It can only be applied if the designated custom element has been defined within the document and extends the specified element type.
Example
<p is="word-count"></p>
Key Points
- Custom Elements: The
is
attribute allows standard HTML elements to adopt custom behaviors, provided the custom element is already defined in the document. - Usage Limitation: This attribute only works with elements that extend built-in HTML elements (e.g.,
<p is="custom-element">
), not standalone custom elements.
See also
- All global attributes.
Conclusion
The is
attribute in HTML allows standard elements to adopt custom behaviors by associating them with predefined custom components. It only works when the custom element is already defined and extends an existing HTML element. This enables dynamic styling and functionality enhancements while maintaining compatibility with native HTML elements.
inert
The inert attribute in HTML designates an element and its children as inactive, blocking user interaction with them while still retaining their presence in the DOM.
ismap
The ismap attribute in HTML marks an image as part of a server-side image map with clickable areas and is a boolean attribute.