How do you select elements based on their style?

后端 未结 3 1703
清歌不尽
清歌不尽 2020-11-30 04:19

Using jQuery, how would you find elements which have a particular style (eg: float: left), regardless of whether it\'s an inline style or one defined in a CSS f

3条回答
  •  渐次进展
    2020-11-30 04:47

    Using the filter function:

    $('*').filter(function() {
         return $(this).css('float') == 'left';
    });
    

    Replace '*' with the appropriate selectors for your case.

提交回复
热议问题