aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/api/document/createtextnode/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ko/web/api/document/createtextnode/index.html')
-rw-r--r--files/ko/web/api/document/createtextnode/index.html60
1 files changed, 60 insertions, 0 deletions
diff --git a/files/ko/web/api/document/createtextnode/index.html b/files/ko/web/api/document/createtextnode/index.html
new file mode 100644
index 0000000000..2da7134fbb
--- /dev/null
+++ b/files/ko/web/api/document/createtextnode/index.html
@@ -0,0 +1,60 @@
+---
+title: Document.createTextNode()
+slug: Web/API/Document/createTextNode
+tags:
+ - DOM
+ - Gecko
+translation_of: Web/API/Document/createTextNode
+---
+<div>{{APIRef("DOM")}}</div>
+
+<h3 id=".EC.9A.94.EC.95.BD" name=".EC.9A.94.EC.95.BD">요약</h3>
+
+<p>텍스트 노드를 생성합니다.</p>
+
+<h3 id=".EB.AC.B8.EB.B2.95" name=".EB.AC.B8.EB.B2.95">문법</h3>
+
+<pre class="eval"><em>텍스트</em> = document.createTextNode(<em>데이터</em>);
+</pre>
+
+<h3 id=".EB.A7.A4.EA.B0.9C.EB.B3.80.EC.88.98" name=".EB.A7.A4.EA.B0.9C.EB.B3.80.EC.88.98">매개변수</h3>
+
+<ul>
+ <li><code>텍스트</code> 생성된 텍스트 노드입니다.</li>
+ <li><code>데이터</code> 텍스트 노드에 쓰여지는 문자열입니다.</li>
+</ul>
+
+<h3 id=".EC.98.88.EC.A0.9C" name=".EC.98.88.EC.A0.9C">예제</h3>
+
+<pre>&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;createTextNode 예제&lt;/title&gt;
+
+&lt;script type="text/javascript"&gt;
+
+function addTextNode()
+{
+var newtext = document.createTextNode(" 동적으로 추가되는 텍스트. ");
+var para = document.getElementById("p1");
+para.appendChild(newtext);
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body&gt;
+&lt;div style="border: 1px solid red"&gt;
+&lt;p id="p1"&gt;단락의 첫번째 줄.&lt;br /&gt;&lt;/p&gt;
+&lt;/div&gt;&lt;br /&gt;
+
+&lt;button onclick="addTextNode();"&gt;TextNode 추가하기.&lt;/button&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
+</pre>
+
+<h3 id=".EA.B7.9C.EC.95.BD" name=".EA.B7.9C.EC.95.BD">규약</h3>
+
+<p><a class="external" href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1975348127">createTextNode </a></p>
+
+<p>{{ languages( { "en": "en/DOM/document.createTextNode", "fr": "fr/DOM/document.createTextNode", "pl": "pl/DOM/document.createTextNode" } ) }}</p>