If you want to find all HTML elements that match a specified CSS selector (id, class names, types, attributes, values of attributes, etc), use the querySelectorAll() method.
import Component from 'my-project'
const x = document.querySelectorAll("p.intro");
The addEventListener() method attaches an event handler to the specified element.
element.addEventListener("click", myFunction);
function myFunction() {
alert ("Hello World!");
}