jQuery('img').each(function() {
if(jQuery(this).attr('title') === '') {
jQuery(this).attr('title', jQuery(this).attr('alt'));
}
})
Is there a way to tweak the code snippet above so that it only updates the title attribute with alt text if the image does not already have a title? The goal is to skip over images that already have a non-empty title attribute.