Thanks everyone! Wrapping my code in `DOMContentLoaded` fixed it. Didn’t realize the script was running too early.
Also, tried `querySelectorAll` like some of you suggested, and it’s way cleaner with `forEach`.
One last thing—if I dynamically add more elements later, should I re-run the selector or is there a smarter way?
Also, tried `querySelectorAll` like some of you suggested, and it’s way cleaner with `forEach`.
One last thing—if I dynamically add more elements later, should I re-run the selector or is there a smarter way?
