Text()

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Text() 생성자는 옵션인 파라미터로 주어진 문자형 컨텐츠인 DOMString 으로 새롭게 생성된 Text 객체를 반환합니다.

문법

text1 = new Text(); // 빈 텍스트 노드 생성
text2 = new Text("텍스트 노드입니다");

예제

text = new Text("Test");

명세

Specification
DOM Standard
# ref-for-dom-text-text①

브라우저 호환성

BCD tables only load in the browser

함께 보기