by: Saravanan Arumugam
Page views:

Here's the simple jQuery script that used to replace string with another. Replace() method searches

specified string value and it will return specified replace value.


<meta charset="utf-8">

<title>Hello User!</title>

<script src="" type="text/javascript"></script>

<script type="text/javascript">

$(document).ready(function () {

$(".element span,p").text(function (index, text) {

return text.replace('Hello world', 'dotnetfox');






<div class="element">

<span>Hello world</span>

<p>Hello world</p>




Please subscribe, if you want to get email updates (it's free).

comments powered by Disqus
Subscribe via Email
message to display in fancybox