Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36
Chrome 78
Linux
Desktop
5 years ago
Test name Executions per second
Pure JS .innerText 881270.2 Ops/sec
Pure JS .innerHTML 193520.1 Ops/sec
Pure JS .textContent 3342589.0 Ops/sec
jQuery .text() 429726.4 Ops/sec
jQuery .html() 119558.5 Ops/sec
jQuery .find().text() 286317.4 Ops/sec
jQuery .find().html() 107498.7 Ops/sec
HTML Preparation code:
Tests:
  • Pure JS .innerText

  • Pure JS .innerHTML

  • Pure JS .textContent

  • jQuery .text()

  • jQuery .html()

  • jQuery .find().text()

  • jQuery .find().html()