getSpecificity method

Obtains the specificity of a passed selector or list of selectors, as per the W3C spec on selector specificity.

Note These APIs can only be used with F12 developer tools and the Diagnostics Script Engine, and can't be called from JavaScript.

Syntax

var retVal = DiagnosticsStyles.getSpecificity(selector);

Parameters

  • selector [in]
    Type: DOMString

    A CSS selector or a comma-separated selector list.

Return value

Type: any

Object or array containing the following info:

  • Count of the number of ID selectors in the selector.
  • Count of the number of class selectors, attributes selectors, and pseudo-classes in the selector.
  • Count of the number of type selectors and pseudo-elements in the selector.

See also

DiagnosticsStyles