Run details:
Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Firefox/52.0
Firefox 52
Windows XP
Other
7 years ago
Test name Executions per second
classList.add/classList.remove (1 class) 31909.6 Ops/sec
function addClass/function removeClass (1 class) 15268.5 Ops/sec
jQuery (1 class) 11295.0 Ops/sec
classList.add/classList.remove (2 class) 23114.8 Ops/sec
function addClass/function removeClass (2 class) 12515.0 Ops/sec
jQuery (2 class) 10773.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • classList.add/classList.remove (1 class)

  • function addClass/function removeClass (1 class)

  • jQuery (1 class)

  • classList.add/classList.remove (2 class)

  • function addClass/function removeClass (2 class)

  • jQuery (2 class)


;