querySelectorAll input
时间: 2023-10-14 10:26:27 浏览: 103
checkBox selectAll
querySelectorAll is a method in JavaScript that allows you to select multiple elements on a web page using a CSS selector. The input parameter of this method is a string that represents the CSS selector. This selector is used to match one or more elements in the DOM tree of the web page. The method returns a NodeList object that contains all the matching elements. You can then use this NodeList to perform operations on each element, such as changing their styles or adding event listeners.
For example, if you want to select all the input elements in a web page, you can use the following code:
```
const allInputs = document.querySelectorAll('input');
```
This will select all the input elements and return a NodeList object that you can use to perform operations on each input element.
阅读全文