1// This selects the first element with that name
2document.querySelector('[name="your-selector-name-here"]');
1//Pretend there is a <p> with class "example"
2const myParagraph = document.querySelector('.example');
3//You can do many this with is
4myParagraph.textContent = 'This is my new text';
1document.querySelectorAll('[property]'); // All with attribute named "property"
2document.querySelectorAll('[property="value"]'); // All with "property" set to "value" exactly.
3
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=""])');