Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109
Windows
Desktop
one year ago
Test name Executions per second
Pure JS .innerText 865974.4 Ops/sec
Pure JS .innerHTML 299070.6 Ops/sec
Pure JS .textContent 2666930.5 Ops/sec
jQuery .text() 405990.2 Ops/sec
jQuery .html() 190077.1 Ops/sec
jQuery .find() 317802.1 Ops/sec
jQuery .find().html() 160591.6 Ops/sec
HTML Preparation code:
Tests:
  • Pure JS .innerText

  • Pure JS .innerHTML

  • Pure JS .textContent

  • jQuery .text()

  • jQuery .html()

  • jQuery .find()

  • jQuery .find().html()


;