$('img').filter(function() { return !this.alt; }).attr('alt', 'this is empty');