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

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -