CSS stuff from JS (no frameworks)

[[CSS in JS Frameworks]]

const elem = document.querySelector(". foo") ;
elem. classList. contains('bar"); // true
elem.matches("bar"):
// true

Last update: 2023-02-03