$("h2:contains('cow')").html(function(_, html) {
return html.replace(/(cow)/g, '<span class="smallcaps">$1</span>');
});
More Related Contents:
- Remove all HTMLtags in a string (with the jquery text() function)
- jQuery Adding new option to select element doesn't pick up the string [closed]
- Using .text() to retrieve only text not nested in child tags
- How can I find elements by text content with jQuery?
- Find text string using jQuery?
- Select which href ends with some string
- How can I change the text color with jQuery?
- Append text to input field
- auto resize text (font size) when resizing window?
- jQuery – replace all instances of a character in a string [duplicate]
- jQuery if div contains this text, replace that part of the text
- typing animated text
- Get the current jQuery selector string?
- jQuery remove tag from HTML String without RegEx
- How to get id from url?
- How to get a table cell value using jQuery?
- jQuery disable a link
- Change Active Menu Item on Page Scroll?
- How to wait 5 seconds with jQuery?
- Select elements by attribute
- Close Bootstrap Modal
- Wrap tags around http text
- HTML Table to JSON
- JQuery data selector not updating with .data
- Find all unchecked checkboxes in jQuery
- Using jQuery how do I select a range of rows?
- How to use Plugins for PopUp [closed]
- Async and document ready
- jQuery delay() – how to stop it?
- Remove elements onclick (including the remove button itself) with jQuery