jQuery Replace Specific Text

Sometimes you may want to replace the text in a specific div or element with something else. For example you are using an off the shelf script and don’t want to edit the core files, but it doesn’t meet your specific needs or brand.

The following is a very simple jQuery snippet that replaces specific text with something else:-

<script type="text/javascript">
  jQuery('.your-div:contains("Some Text")').text( "New Text" );


About the Author
jQuery Replace Specific Text jQuery Replace Specific Text 0da77002febbfe28d15144a57bbcc2c9 s 180 d mm r g


A highly experienced Web Designer / Web Developer (Webflow, WordPress, Weebly & Custom), Front-end / Back-end Developer & New Media Specialist, with extensive knowledge of a wide spectrum of technologies in the Development and Creative Industries, built up over a number of years.