[javascript] createDocumentFragment()

sunny·2021년 1월 10일
0
post-thumbnail

createDocumentFragment()

다른 노드를 담는 임시 컨테이너 역할을 하는 특수노드이다. 하지만 Element처럼, appendChild()와 insertBefore() 등으로 조작할 수 있는 자손 객체를 가질 수 있다.

var fragment = document.createDocumentFragment();
var tr = document.createElement('tr');
fragment.appendChild(tr);
table.appendChild(fragment);
profile
blog 👉🏻 https://kimnamsun.github.io/

0개의 댓글