🦸 Become A VS Code SuperHero Today: vsCodeHero.com
🧑🏾🤝🧑🏽 Join my Discord developer community: / discord
Did you know that you don't have to use getElementById() or querySelector() to access a DOM element that has an HTML ID?
HTML element IDs are accessible as global variables on the window object.
So, should we stop using `getElementById()` and `querySelector()`?
NO
Even though this does seem to be a convenient way to write a little less code, it should not be used.
It's always good practice to declare your variables.
_____________________________________
🚢 Deploy for FREE on Vercel: vercel.com/amb...
📚 FREE 7-Day trial at Treehouse: treehouse.7eer...
_____________________________________
🛠️ Tools I use:
🟠 codeSTACKr Theme: marketplace.vi...
🟠 STACKr Code Font (Exclusive to my VS Code Course - vsCodeHero.com)
🟠 SuperHero Extension Pack: marketplace.vi...
_____________________________________
💖 Show support!
PayPal: paypal.me/code...
_____________________________________
👀 Watch Next:
Playlist: Web Development For Beginners - • Web Development - Begi...
_____________________________________
🌐 Connect With Me:
Website: www.codestackr...
Twitter: / codestackr
Instagram: / codestackr
Facebook: / codestackr
_____________________________________
** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.
#codeSTACKr #JavaScript #learntocode
15 сен 2024