Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to give index in query selector in js

// document.getElementsByClassName("first")[1].getElementsByClassName("second")[2];

document.querySelector('.first:nth-of-type(2) .second:nth-of-type(3)').style = 'border: 1px solid red;'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #give #index #query #selector #js
ADD COMMENT
Topic
Name
8+7 =