Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Chrome 106
Linux
Desktop
2 years ago
Test name Executions per second
Pure JS .innerText 292053.4 Ops/sec
Pure JS .innerHTML 115725.6 Ops/sec
Pure JS .textContent 2000425.1 Ops/sec
jQuery .text() 117095.4 Ops/sec
jQuery .html() 70147.5 Ops/sec
jQuery .find().text() 95332.0 Ops/sec
jQuery .find().html() 60408.7 Ops/sec
HTML Preparation code:
Tests:
  • Pure JS .innerText

  • Pure JS .innerHTML

  • Pure JS .textContent

  • jQuery .text()

  • jQuery .html()

  • jQuery .find().text()

  • jQuery .find().html()