Run details:
Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Chrome 69
Windows 8.1
Desktop
6 years ago
Test name Executions per second
Pure JS .innerText 2019054.4 Ops/sec
Pure JS .innerHTML 235771.1 Ops/sec
Pure JS .textContent 3288099.2 Ops/sec
jQuery .text() 420673.0 Ops/sec
jQuery .html() 124067.1 Ops/sec
jQuery .find() 310392.2 Ops/sec
jQuery .find().html() 109965.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()


;