Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

use css child selector inside js

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

all children example:
document.querySelectorAll("div a") // returns NodeList[a, etc...]
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #css #child #selector #js
ADD COMMENT
Topic
Name
7+9 =