Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36
Chrome 59
Linux
Other
6 years ago
Test name Executions per second
Pure JS .innerText 222831.2 Ops/sec
Pure JS .innerHTML 715084.1 Ops/sec
Pure JS .textContent 1146725.0 Ops/sec
jQuery .text() 261116.1 Ops/sec
jQuery .html() 200091.7 Ops/sec
jQuery .find().text() 144410.1 Ops/sec
jQuery .find().html() 127188.1 Ops/sec
HTML Preparation code:
Tests:
  • Vanilla JS .innerText

  • Vanilla JS .innerHTML

  • Vanilla JS .textContent

  • Vanilla JS (querySelector) .innerText

  • Vanilla JS (querySelector) .innerHTML

  • Vanilla JS (querySelector) .textContent

  • Vanilla JS (querySelectorAll) .innerText

  • Vanilla JS (querySelectorAll) .innerHTML

  • Vanilla JS (querySelectorAll) .textContent

  • Cash .text

  • Cash .html

  • jQuery .text()

  • jQuery .html()

  • jQuery .find() .text()

  • jQuery .find() .html()