Skip to content
loading...

re: Generate and Set Pseudorandom Hexadecimal Background Color Using JavaScript VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Thanks for the heads up. Does using id's to link js to the DOM hurt performance (at scale)?
 

I saw a tweet about this last week! Using document.querySelector('body') is actually more performant than using document.body. So I wonder if doing document.querySelector('#some-id') would still be faster than document.body! :)

I wonder if there's a jsPerf for that by now. I'm really curious to see which method is more performant.

code of conduct - report abuse