title: Compute which JS selector will take priority
body: <p>Is it possible in JavaScript to check which element selector would take precedence in JavaScript, given a list of selectors?</p>
  <p>For example, if I have the following two selectors:</p>
  <p>selA: body.app &gt; #container</p>
  <p>selB: #container</p>
  <p>Is it possible to check in JS which selector “applies more” to a given element? So far I have been doing the following to check if an element matches a selector:</p>
  <pre><code>el.matches(selA)
  </code></pre>
  <p>But I need to know which of the two selectors has a higher precedence/priority on this specific element (el). Is this possible to compute in JS?</p>