1const allSpanElements = document.querySelectorAll('span');
2
3allSpanElements.forEach((spanElement) => {
4 // Here comes the Code that should be executed on every Element, e.g.
5 spanElement.innerHTML = "This Content will appear on every span Element now";
6});
1/*The querySelector() method returns the first element that matches a specified
2CSS selector(s) in the document. Note: The querySelector() method only returns
3the first element that matches the specified selectors. To return all the
4matches, use the querySelectorAll() method instead.*/
5
6// for example
7
8//for class
9document.querySelector(".ClassName")
10
11// for id
12document.querySelector("#ID")
13
14// etc.
1var test = document.querySelectorAll('input[value][type="checkbox"]:not([value=""])');