使用jquery替换特定的tr内容

I have a table as the following:

<table>
    <tr>...<tr>
    <tr>...<tr>
    <tr class="replace">...<tr>
    <tr class="replace">...<tr>
    <tr class="replace">...<tr>
    <tr>...<tr>
    <tr>...<tr>
</table>

Using jQuery and AJAX, I want to replace the content of all the <tr> with the class name "replace."

Like that for example:

$('table tr.replace').each(function(){
   $(this).html('New Content');
});

Reference: here

Simply use jQuery's method .html()

$("tr.replace").html('<td>New content comes here</td>');
$(".replace").each(function() { 
    $(this).html("your content here"); 
});

This will replace the content of all tr elements with the class replace. If you want to put different content in each tr, you should make the classes unique by add a counter to the class, for example replace1, replace2, etc.

The selector would then change into $("[class^='replace']").