re: Matching elements with selectors in JS VIEW POST


Just a nitpick:
The following line:

el.classList.has('foo') /* becomes */ el.matches('.foo');

I think you mean 'contains' instead of 'has'

  • Uncaught TypeError: elem.classList.has is not a function

Oh yeah, I think I was thinking of Set or Map. I'll fix, thanks! 👍

code of conduct - report abuse