jquerycsscss-floatclearfix

Jquery how to find floating elements in DOM?


Jquery how to find floating elements in DOM?

 float: left/right

Clearfix is related to element float. That is not needed in our case. How to find which elements floating in DOM?


Solution

  • You can use .filter() and call the css() method to get the value of the float style. For instance, this will find all divs with float: left

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