Is there a better way of writing this code:
$('img').filter(function() { return $(this).attr('align').length > 0; }).parent().css('background', 'red');
The goal is to select all image elements on the page that have an ‘align’ attribute and apply a style to the parent.
there you go 🙂
http://jsfiddle.net/2u7fg/3/