aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/html/global_attributes/is/index.html
blob: 99e72adade9f04ef22fc328a46e1c222cc5119a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: is
slug: Web/HTML/Global_attributes/is
tags:
  - Global attributes
  - HTML
  - Reference
translation_of: Web/HTML/Global_attributes/is
---
<div>{{HTMLSidebar("Global_attributes")}}</div>

<p><strong><code>is</code></strong> <a href="/ko/docs/Web/HTML/Global_attributes">전역 특성</a>은 표준 HTML 요소가 사용자 지정 요소처럼 행동하도록 지정합니다. <a href="/ko/docs/Web/Web_Components/Using_custom_elements">사용자 지정 요소 사용하기</a>를 방문해 더 자세한 정보를 알아보세요.</p>

<p>이 특성은 주어진 사용자 지정 요소의 이름을 현재 문서에 성공적으로 <a href="/ko/docs/Web/API/CustomElementRegistry/define">정의</a>했고, <code>is</code> 특성을 적용하려는 요소를 확장하는 경우에만 사용할 수 있습니다.</p>

<h2 id="예제">예제</h2>

<p>다음 코드는 <a href="https://github.com/mdn/web-components-examples/tree/master/word-count-web-component">word-count-web-component</a> 예제에서 발췌한 것입니다. (<a href="https://mdn.github.io/web-components-examples/word-count-web-component/">실제 동작 보기</a>)</p>

<pre class="brush: js notranslate">// 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' });</pre>

<pre class="brush: html notranslate">&lt;<span class="pl-ent">p</span> <span class="pl-e">is</span>=<span class="pl-s"><span class="pl-pds">"</span>word-count<span class="pl-pds">"</span></span>&gt;&lt;/<span class="pl-ent">p</span>&gt;</pre>

<h2 id="명세">명세</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('HTML WHATWG', "custom-elements.html#attr-is", "is")}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td></td>
  </tr>
 </tbody>
</table>

<h2 id="브라우저_호환성">브라우저 호환성</h2>



<p>{{Compat("html.global_attributes.is")}}</p>

<h2 id="같이_보기">같이 보기</h2>

<ul>
 <li>모든 <a href="/ko/docs/Web/HTML/Global_attributes">전역 특성</a>.</li>
</ul>