change text jquery code example

Example 1: jquery replace text

$('#id1 p').each(function() {
    var text = $(this).text();
    $(this).text(text.replace('Kate', 'Nef')); 
});

Example 2: jquery set text of h1

$('#id').text("New Text");

Example 3: To set the text of button using Jquery

BY LOVE
  $('#btnid').text('Show');

Example 4: jquery button text

$("#my-button").attr("value", "Button Text");

Example 5: jquery change text of div

$('#dialog_title_span').text("new dialog title");

Example 6: jquery change text

$(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