jQuery - remove widows
$(function(){ //Loop through each title $("h3").each(function(){ var content = $(this).text().split(" "); var widow = " "+content.pop(); $(this).html(content.join(" ")+widow); }); });