jquery replace text

JavaScript
$("elementsSelector").replaceWith( "<h2>New content</h2>" );$('#id1 p').each(function() {
    var text = $(this).text();
    $(this).text(text.replace('Kate', 'Nef')); 
});$(yourElement).html("New text");
//sets yourElement innerHTML to "New text"
var text = $(yourElement).html();
//html() returns the text inside yourElement if you pass no parameters$(element).html("Hello World");$('#one span').text('Hi I am replace');
Source

Also in JavaScript: