Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Chrome 76
Windows
Desktop
5 years ago
Test name Executions per second
Select Element by ID - Javascript 2292944.2 Ops/sec
Change CSS - jQuery 176097.8 Ops/sec
Change CSS - Javascript 410383.5 Ops/sec
Select Element by ID - jQuery 953344.4 Ops/sec
Change inner text - Javascript 4413085.0 Ops/sec
Change inner text - jQuery 311792.8 Ops/sec
Get element by tag name - Javascript 2350127.2 Ops/sec
Get element by tag name - jQuery 367607.7 Ops/sec
Get element by name - Javascript 35946.1 Ops/sec
Get element by name - jQuery 20746.8 Ops/sec
Get element by existing attribute - Javascript 31183.8 Ops/sec
Get element by existing attribute - jQuery 16158.8 Ops/sec
Get element by class name - Javascript 1642616.1 Ops/sec
Get element by class name - jQuery 271266.2 Ops/sec
Select sub-element - Javascript 1288904.5 Ops/sec
Select sub-element - jQuery 289960.7 Ops/sec
Loop through elements - Javascript 143464.6 Ops/sec
Loop through elements - jQuery 30595.6 Ops/sec
Add and remove Element - Javascript 314330.0 Ops/sec
Add and remove Element - jQuery 31807.0 Ops/sec
Add and Remove Class - Javascript 383069.4 Ops/sec
Add and Remove Class - jQuery 105400.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Select Element by ID - Javascript

  • Add and remove Element - jQuery

  • Add and remove Element - Javascript

  • Loop through elements - jQuery

  • Loop through elements - Javascript

  • Select sub-element - jQuery

  • Select sub-element - Javascript

  • Get element by class name - jQuery

  • Get element by class name - Javascript

  • Get element by existing attribute - jQuery

  • Get element by existing attribute - Javascript

  • Get element by name - jQuery

  • Get element by name - Javascript

  • Get element by tag name - jQuery

  • Get element by tag name - Javascript

  • Change inner text - jQuery

  • Change inner text - Javascript

  • Select Element by ID - jQuery

  • Change CSS - Javascript

  • Change CSS - jQuery

  • Add and Remove Class - Javascript

  • Add and Remove Class - jQuery


;