+ 6
querySelector vs getElementsByClassName
Why document.querySelector and document.querySelectorAll methods are quite slow than document.getElementById, document.getElementsByClassName, document.getElementsByTagName ones? Is it still actual nowadays? Who can provide evidence, guys?🤔
1 Antwort
+ 2
1. document.querySelector(".cname");
2. document.getElementsByClassName("cname");
The faster one is faster for milli seconds!