Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. HTML
  3. Reference
  4. Global attributes
  5. is

HTML is global attribute

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Theisglobal attribute allows you to specify that a standard HTML element should behave like a defined customized built-in element (seeUsing custom elements for more details).

This attribute can only be used if the specified custom element name has been successfullydefined in the current document, and extends the element type it is being applied to.

Examples

The following code is taken from ourword-count-web-component example (see it live also).

js
// Create a class for the elementclass WordCount extends HTMLParagraphElement {  constructor() {    // Always call super first in constructor    super();    // Constructor contents omitted for brevity    // …  }}// Define the new elementcustomElements.define("word-count", WordCount, { extends: "p" });
html
<p is="word-count"></p>

Specifications

Specification
HTML
# attr-is

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp