Check out example codes for "css queryselector". It will help you in understanding the concepts better.

Code Example 1

//Pretend there is a <p> with class "example"
const myParagraph = document.querySelector('.example');
//You can do many this with is
myParagraph.textContent = 'This is my new text';

Code Example 2

document.querySelectorAll

Code Example 3

document.querySelector(".example");

Code Example 4

/*Do this for classes*/
document.querySelector(".example"); 
/*Do this for IDs*/
document.querySelector("#example");
/*This selects all of the elements in those groups*/

Learn ReactJs, React Native from akashmittal.com