Ruphaa's Notes

How to check if the element has the specified class?

js

hasClass(document.querySelector("p.special"), "special");

const hasClass = (el, className) => el.classList.contains(className);