How to use replace in jQuery? -


can tell me wrong code:

$("#replace").text().replace("cat","dog"); 

you not replacing text of element. you're getting , replacing text not updating dom.

$("#replace").text($('#replace').text().replace("cat","dog")); 

or

$("#replace").text(function() {     return $(this).text().replace("cat", "dog"); }); 

Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -