Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Chrome 111
Windows
Desktop
one year ago
Test name Executions per second
Pure JS .innerText 1096742.2 Ops/sec
Pure JS .innerHTML 323242.8 Ops/sec
Pure JS .textContent 2504458.5 Ops/sec
jQuery .text() 502389.1 Ops/sec
jQuery .html() 190541.3 Ops/sec
jQuery .find() 327455.7 Ops/sec
jQuery .find().html() 4026.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()