Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Chrome 105
Windows
Desktop
one year ago
Test name Executions per second
Pure JS .innerText 796563.6 Ops/sec
Pure JS .innerHTML 239259.1 Ops/sec
Pure JS .textContent 1896083.8 Ops/sec
jQuery .text() 356791.8 Ops/sec
jQuery .html() 167804.3 Ops/sec
jQuery .find() 260366.7 Ops/sec
jQuery .find().html() 139874.1 Ops/sec
HTML Preparation code:
Tests:
  • Pure JS .innerText

  • Pure JS .innerHTML

  • Pure JS .textContent

  • jQuery .text()

  • jQuery .html()

  • jQuery .find()

  • jQuery .find().html()