Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.54
Chrome 108
Windows
Desktop
one year ago
Test name Executions per second
Pure JS .innerText 858452.2 Ops/sec
Pure JS .innerHTML 225287.4 Ops/sec
Pure JS .textContent 2412072.0 Ops/sec
jQuery .text() 384199.5 Ops/sec
jQuery .html() 162897.7 Ops/sec
jQuery .find() 265462.9 Ops/sec
jQuery .find().html() 143824.9 Ops/sec
HTML Preparation code:
Tests:
  • Pure JS .innerText

  • Pure JS .innerHTML

  • Pure JS .textContent

  • jQuery .text()

  • jQuery .html()

  • jQuery .find()

  • jQuery .find().html()


;