Message from JavaScript discussions

November 2020

— Basically its just for adding a border to one element at the time


Any idea why document.querySelector("div a") returns an array (or at least looks like an array) of four elements (the same, just repeated four times), instead of just the first matching element?

— How are you accessing the "array"?

— Let targetNode = document.querySelector("div a");

But that didn't work; I saw it had four equal elements with targetNode.length and checked the contents with targetNode[0].target.classList (from 0 to 3, obviously).

Message permanent page

— Anyway, nevemind, I took a dirtier, nondynamic approach and finally solved the issue. Hopefully it won't require being dynamic.

Message permanent page

— Yep

— Makes sense, but Record is simpler in some cases

— Watch any Ryan talk on it

— Https://

— It doesn't

— Hi

— Can help me ? Console.log