is

Limited availability

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

is 전역 특성은 표준 HTML 요소가 사용자 지정 요소처럼 행동하도록 지정합니다. 사용자 지정 요소 사용하기를 방문해 더 자세한 정보를 알아보세요.

이 특성은 주어진 사용자 지정 요소의 이름을 현재 문서에 성공적으로 정의했고, is 특성을 적용하려는 요소를 확장하는 경우에만 사용할 수 있습니다.

예제

다음 코드는 word-count-web-component 예제에서 발췌한 것입니다. (실제 동작 보기)

js
// Create a class for the element
class WordCount extends HTMLParagraphElement {
  constructor() {
    // Always call super first in constructor
    super();

    // Constructor contents ommitted for brevity
    ...

  }
}

// Define the new element
customElements.define('word-count', WordCount, { extends: 'p' });
html
<p is="word-count"></p>

명세

Specification
HTML
# attr-is

브라우저 호환성

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
is

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

같이 보기