Skip to content

Instantly share code, notes, and snippets.

@JRMorris77
Created April 11, 2017 07:13
Show Gist options
  • Save JRMorris77/61d5f0cd298517c1389dccb4246959e1 to your computer and use it in GitHub Desktop.
Save JRMorris77/61d5f0cd298517c1389dccb4246959e1 to your computer and use it in GitHub Desktop.
<script>
//Add HTML elements around text strings inside of a parent element.
jQuery("div.feature-text:contains('products')").html(function(_, html) {
return html.split('products').join("<a class='a'>products</a>");
});
jQuery("div.feature-text:contains('100')").html(function(_, html) {
return html.split('100').join("<a class='b'>100</a>");
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment