rsk82
rsk82

Reputation: 29397

having a CSSStyleDeclaration object can I find what node it belongs to?

I mean the reverse of this function:

styleObj = window.getComputedStyle(node);

So something like this:

node = window.getNodeFromStyle(styleObj);

Upvotes: 0

Views: 183

Answers (1)

Emil Stenström
Emil Stenström

Reputation: 14106

Short answer: No.

A CSSStyleDeclaration is just some style rules, they could be attached to any element.

Upvotes: 1

Related Questions