<section class="box" id="sect1">
<div data-name="funnel-chart-percent1">10.900%</div>
<div data-name="funnel-chart-percent2">3700.00%</div>
<div data-name="funnel-chart-percent3">0.00%</div>
</section>Element: querySelectorAll() method / notebook
Element: querySelectorAll() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const refs = [
...document.querySelectorAll(`[data-name*="funnel-chart-percent"]`),
];const matches = myBox.querySelectorAll("p");const matches = myBox.querySelectorAll("div.note, div.alert");const container = document.querySelector("#test");
const matches = container.querySelectorAll("div.highlighted > p");const matches = document.querySelectorAll("iframe[data-src]");const container = document.querySelector("#user-list");
const matches = container.querySelectorAll("li[data-active='1']");const highlightedItems = userList.querySelectorAll(".highlighted");
highlightedItems.forEach((userItem) => {
deleteUser(userItem);
});<button id="select">Select</button>
<button id="select-scope">Select with :scope</button>
<div id="outer">
#outer
<div id="subject">
#subject
<div id="inner">#inner</div>
</div>
</div>
<pre id="output"></pre>