JSFiddle - React, Tailwind, and code Playground
by brigand
HTML
<div id="el" role="foo bar"></div>
<div id="out"></div>
JavaScript
out.textContent = [
el.matches('[role~=foo]'),
el.matches('[role~=bar]'),
el.matches('[role~=oo]'),
]
by brigand
<div id="el" role="foo bar"></div>
<div id="out"></div>
out.textContent = [
el.matches('[role~=foo]'),
el.matches('[role~=bar]'),
el.matches('[role~=oo]'),
]