Answers for "css select all links in div"

1

css select all links in div

single direct child example:
document.querySelector("div > a") // returns the <a> link

all children example:
document.querySelectorAll("div a") // returns NodeList[a, etc...]
Posted by: Guest on November-22-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language