getElementById vs getElementsByNameFastest: getElementById (1.8x faster)
19,480,082 ops/sec
10,658,136 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| getElementById | |
| getElementsByName |
| Test name | Executions per second |
|---|---|
| ✓ getElementById | 47,367,068 Ops/sec |
| getElementsByName | 21,625,008 Ops/sec |