Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53
Mobile Safari 7
iOS 7.1.2
iPhone
6 years ago
Test name Executions per second
Pure JS .innerText 64327.4 Ops/sec
Pure JS .innerHTML 17521.2 Ops/sec
Pure JS .textContent 19526.5 Ops/sec
jQuery .text() 7115.4 Ops/sec
jQuery .html() 6810.9 Ops/sec
jQuery .find().text() 5644.1 Ops/sec
jQuery .find().html() 5743.8 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()