Tell me how to check the width of bar, and if for example it is less than the required value, add a class to this element and leave the rest as is. Tried through $ (this) did not work.
<div class='wrp'> <div class='bar' style='width: 1%'> </div> </div> <div class='wrp'> <div class='bar' style='width: 19%'> </div> </div> <div class='wrp'> <div class='bar' style='width: 54%'> </div> </div> var bar = $(this).closest('.wrp').find('.bar').width(); if(bar > 20) { bar.addClass('reverse'); }