Javascript, CSS: Get element by style attribute

后端 未结 5 1682
逝去的感伤
逝去的感伤 2020-12-03 17:38

I\'d like to:

  1. Find a style attribute for all elements in the page (for instance: all elements that have color:#333;)
  2. Change this attribut
5条回答
  •  既然无缘
    2020-12-03 18:19

    You can't, if you don't add at least a specific CSS class to all this elements you want to track.

    Or better, you can with very poor performances by looping on all the elements of the DOM until you find what you're looking for. But please, don't think of doing this

提交回复
热议问题