Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
Chrome 78
Windows
Desktop
5 years ago
Test name Executions per second
Pure JS .innerText 1018521.2 Ops/sec
Pure JS .innerHTML 236018.1 Ops/sec
Pure JS .textContent 3025068.2 Ops/sec
jQuery .text() 454252.0 Ops/sec
jQuery .html() 142641.7 Ops/sec
jQuery .find() 329380.2 Ops/sec
jQuery .find().html() 125834.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()