Run details:
Mozilla/5.0 (Linux; Android 11; Mi 9 Lite) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/18.0 Chrome/99.0.4844.88 Mobile Safari/537.36
Chrome Mobile 99
Android
Mobile
2 years ago
Test name Executions per second
Pure JS .innerText 261528.2 Ops/sec
Pure JS .innerHTML 51997.0 Ops/sec
Pure JS .textContent 888588.9 Ops/sec
jQuery .text() 128173.5 Ops/sec
jQuery .html() 31249.7 Ops/sec
jQuery .find() 107715.8 Ops/sec
jQuery .find().html() 27421.2 Ops/sec
HTML Preparation code:
Tests:
  • Pure JS .innerText

  • Pure JS .innerHTML

  • Pure JS .textContent

  • jQuery .text()

  • jQuery .html()

  • jQuery .find()

  • jQuery .find().html()