[Solved] Search Text and Replace with JavaScript

[ad_1]

var ele = $("div.description");                     //Let ele be target element
ele.html(ele.html().replace(/smile/gi,"think"));    //Replace the word in string,
                                                    // then put it back in.

.replace: MDN

Demo: http://jsfiddle.net/DerekL/FdyEH/

0

[ad_2]

solved Search Text and Replace with JavaScript