How can I get list of all element css attributes with jQuery?

后端 未结 4 604
既然无缘
既然无缘 2020-12-01 08:20

I need to get list of elements all css attributes. How can I do that ?

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-01 09:16

    For inline styles:

    var styles = $("#someelement").attr("style");
    

    From there, you should be able to split this string if you need to loop the styles.

    To check individual styles, check the docs:

    http://docs.jquery.com/CSS

提交回复
热议问题