var trunc='Our 10-step game plan for avoiding Thanksgiving dinner\'s most pesky, lingering side effect.'; function getLeadingHtml (input, maxChars) { var token = /\w+|[^\w<]|<(\/)?(\w+)[^>]*(\/)?>|"; return output; }; trunc = getLeadingHtml(trunc,47) trunc=(trunc+'...'); document.write('
');