Replacing the content of a <td> with <tr> id and <tr> index
<p>I have a table structure like this</p>

<pre><code>&lt;table&gt;
    &lt;tr id="tr_1"&gt;
        &lt;td&gt;Content1&lt;/td&gt;
        &lt;td&gt;Content2&lt;/td&gt;
        &lt;td&gt;Content3&lt;/td&gt;
        &lt;td&gt;Content4&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr id="tr_2"&gt;
        &lt;td&gt;Content5&lt;/td&gt;
        &lt;td&gt;Content6&lt;/td&gt;
        &lt;td&gt;Content7&lt;/td&gt;
        &lt;td&gt;Content8&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr id="tr_1"&gt;
        &lt;td&gt;Content11&lt;/td&gt;
        &lt;td&gt;Content12&lt;/td&gt;
        &lt;td&gt;Content13&lt;/td&gt;
        &lt;td&gt;Content14&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr id="tr_2"&gt;
        &lt;td&gt;Content15&lt;/td&gt;
        &lt;td&gt;Content16&lt;/td&gt;
        &lt;td&gt;Content17&lt;/td&gt;
        &lt;td&gt;Content18&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>I am passing the row index(2) and <code>&lt;tr&gt;</code> id (tr_1) to a js function for replacing the content of 2nd 3 rd td's in that row.
i have a jquery funcion</p>

<pre><code>document.getElementById('tr_1').getElementsByTagName("td")[2].innerHTML = '&lt;td&gt;New html&lt;/td&gt;';
</code></pre>

<p>But that this replacing the first <code>tr</code> html. How we can replace with id <code>tr_1</code> with index 2</p>
