Answers for "select all elements of a certain class javascript"

8

javascript get all elements with class

const allElementContainGrepperClassName = document.querySelectorAll('.grepper');
// => return array of all elements 

const firstElementContainGrepperClassName = document.querySelector('.grepper');
Posted by: Guest on January-12-2021
0

javascript select all divs with class

let divs = document.querySelectorAll('.className');
OR
let divs = document.getElementsByClassName('className');
Posted by: Guest on January-07-2022

Code answers related to "select all elements of a certain class javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language