jQuery.css vs getComputedStyle() vs getStyle() vs getStyle2()Fastest: getStyle() (3.8x faster)
2,457,893 ops/sec
1,302,510 ops/sec
1,231,703 ops/sec
647,317 ops/sec
Fastest: getStyle2() (2.1x faster)
1,814,624 ops/sec
1,693,467 ops/sec
1,451,813 ops/sec
857,330 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| jQuery.css | |
| getComputedStyle() | |
| getStyle() | |
| getStyle2() |
| Test name | Executions per second |
|---|---|
| ✓ getStyle() | 965,287 Ops/sec |
| getComputedStyle() | 695,926 Ops/sec |
| getStyle2() | 683,406 Ops/sec |
| jQuery.css | 361,208 Ops/sec |