Favorites

HTML is Global Attribute

is
HTML Global AttributeThis global attribute is supported in some modern browsers, but not all.
Updated 22nd November 2026

The is attribute turns a built-in element, such as a button, into a customized built-in element defined in JavaScript. Safari does not support it.

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee

Description

The is global attribute makes a standard HTML element behave like a customized built-in element: a custom element that extends a built-in element such as <button> or <ul> instead of the generic HTMLElement.

The element keeps all the behavior, accessibility and form features of the built-in element, and adds the behavior defined in JavaScript. The custom element must be registered with customElements.define() using the extends option, and its class must extend the matching interface:

class FancyButton extends HTMLButtonElement {
  connectedCallback() {
    this.addEventListener("click", () => this.classList.toggle("on"));
  }
}
customElements.define("fancy-button", FancyButton, { extends: "button" });
<button is="fancy-button">Toggle me</button>

The value must be the name of the custom element, which has to contain a hyphen. Safari does not support customized built-in elements and has no plans to, so a polyfill is needed there; autonomous custom elements (<fancy-button>) work in all browsers.

Syntax

<element is="custom-element-name">

Values

  • custom-element-nameThe name of a customized built-in element registered with customElements.define() and the extends option. It must contain a hyphen.

Example

<style>
button.on { background: #4361ee; color: #fff; }
</style>
<button is="fancy-button">Toggle me</button>
<p id="info"></p>
<script>
class FancyButton extends HTMLButtonElement {
connectedCallback() {
this.addEventListener("click", () => this.classList.toggle("on"));
document.getElementById("info").textContent = "fancy-button is defined.";
}
}
customElements.define("fancy-button", FancyButton, { extends: "button" });
</script>
Open in editor

Browser Support

The following information will show you the current browser support for the HTML is global attribute. Hover over a browser icon to see the version that first introduced support for this HTML global attribute.

This global attribute is supported in some modern browsers, but not all.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee