Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // get text of heading
- var plansBlockHeading = $('.first .sub .one h4').text();
- // filter to last 2 chars
- var sup = plansBlockHeading.substr(plansBlockHeading.length-2);
- // Wrap in a <sup></sup>
- $(sup).wrap("<sup />");
- $('.first .sub .one h4').html(function(i, html) {
- // make sure there's no whitespace issues
- html = $.trim(html);
- return html.slice(0, -2) + "<sup>" + html.slice(-2) + "</sup>";
- });
- var text = $('.first .sub .one h4').text();
- text = text.replace(/^(.*)(.{2,2})$/, "$1<sup>$2</sup>");
- $('.first .sub .one h4').html(text);
- var elem = $('.first .sub .one h4'),
- text = elem.text(),
- html = text.slice(0,-2) + '<sup>' + text.slice(-2) + '</sup>';
- elem.html(html);
Add Comment
Please, Sign In to add comment