innerText VS textContent (v2)

Revision 2 of this benchmark created on


Description

DOM 요소의 텍스트를 수정할 때 뭐가 더 나을까

Preparation HTML

<p id='target'>Old Text</p>

Setup

const element = document.getElementById('target')

Test runner

Ready to run.

Testing in
TestOps/sec
textContent
element.textContent = 'New Text'
ready
innerText
element.innerText = 'New Text'
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.