Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0
Firefox 86
Windows
Desktop
3 years ago
Test name Executions per second
Pure JS .innerText 534825.0 Ops/sec
Pure JS .innerHTML 800760.2 Ops/sec
Pure JS .textContent 798752.9 Ops/sec
jQuery .text() 323820.9 Ops/sec
jQuery .html() 303702.8 Ops/sec
jQuery .find() 171590.8 Ops/sec
jQuery .find().html() 166550.3 Ops/sec
HTML Preparation code:
Tests:
  • Pure JS .innerText

  • Pure JS .innerHTML

  • Pure JS .textContent

  • jQuery .text()

  • jQuery .html()

  • jQuery .find()

  • jQuery .find().html()