Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60 [FBAN/FBIOS;FBAV/181.0.0.33.81;FBBV/117675513;FBDV/iPhone6,2;FBMD/iPhone;FBSN/iOS;FBSV/10.3.3;FBSS/2;FBCR/Carrier;FBID/phone;FBLC/he_IL;FBOP/5;FBRV/0]
Mobile Safari 10
iOS 10.3.3
Mobile
5 years ago
Test name Executions per second
Pure JS .innerText 891889.8 Ops/sec
Pure JS .innerHTML 50441.7 Ops/sec
Pure JS .textContent 153683.4 Ops/sec
jQuery .text() 21755.0 Ops/sec
jQuery .html() 20793.5 Ops/sec
jQuery .find().text() 17533.1 Ops/sec
jQuery .find().html() 16764.1 Ops/sec
HTML Preparation code:
Tests:
  • Vanilla JS .innerText

  • Vanilla JS .innerHTML

  • Vanilla JS .textContent

  • Vanilla JS (QuerySelector) .innerText

  • Vanilla JS (QuerySelector) .innerHTML

  • Vanilla JS (QuerySelector) .textContent

  • Vanilla JS (QuerySelectorAll) .innerText

  • Vanilla JS (QuerySelectorAll) .innerHTML

  • Vanilla JS (QuerySelectorAll) .textContent

  • Cash .text

  • Cash .html

  • jQuery .text()

  • jQuery .html()

  • jQuery .find() .text()

  • jQuery .find() .html()