How to get All Defined CSS Selectors for a given DOM Element?

前端 未结 2 1059
灰色年华
灰色年华 2021-01-31 22:58

How to get all DEFINED CSS Selectors for a given DOM Element using jQuery?

With defined I mean all CSS Selectors which are used in any of the Stylesheets applied to the

2条回答
  •  抹茶落季
    2021-01-31 23:45

    I think the two features are not similar.

    Furthermore, I think nor jQuery nor the browser keep trace of selectors used through javascript code or stylesheet file; selectors are used to reference one or more DOM elements, to eventually apply styles to them.

    So, what it is kept are the styles, not the used selectors.

    Hope this helps.

提交回复
热议问题