--- title: is slug: Web/HTML/Global_attributes/is tags: - Global attributes - HTML - Reference translation_of: Web/HTML/Global_attributes/is ---
is
전역 특성은 표준 HTML 요소가 사용자 지정 요소처럼 행동하도록 지정합니다. 사용자 지정 요소 사용하기를 방문해 더 자세한 정보를 알아보세요.
이 특성은 주어진 사용자 지정 요소의 이름을 현재 문서에 성공적으로 정의했고, is
특성을 적용하려는 요소를 확장하는 경우에만 사용할 수 있습니다.
다음 코드는 word-count-web-component 예제에서 발췌한 것입니다. (실제 동작 보기)
// 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' });
<p is="word-count"></p>
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', "custom-elements.html#attr-is", "is")}} | {{Spec2('HTML WHATWG')}} |
{{Compat("html.global_attributes.is")}}