Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36
Chrome 101
Linux
Desktop
2 years ago
Test name Executions per second
Pure JS .innerText 1635866.8 Ops/sec
Pure JS .innerHTML 586668.1 Ops/sec
Pure JS .textContent 4989882.0 Ops/sec
jQuery .text() 854486.4 Ops/sec
jQuery .html() 399840.9 Ops/sec
jQuery .find().text() 618088.2 Ops/sec
jQuery .find().html() 328341.3 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()