Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36 Edg/88.0.705.63
Chrome 88
Windows
Desktop
3 years ago
Test name Executions per second
Pure JS .innerText 226144.0 Ops/sec
Pure JS .innerHTML 121884.6 Ops/sec
Pure JS .textContent 2681340.2 Ops/sec
jQuery .text() 25507.3 Ops/sec
jQuery .html() 44934.5 Ops/sec
jQuery .find() 109369.4 Ops/sec
jQuery .find().html() 52516.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()


;