I have a table in my page as below;
<table id="tbl" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td class="field1s">field1x</td>
<td class="field2s">field2x</td>
<td class="field3s">field3x</td>
<td class="field4s">field4x</td>
<td class="xx">#</td>
</tr>
</table>
The table contains so many rows. When I click last cell (xx), I want all other texts in the row change to <input type="text" /> having corresponding classes respectively, with their corresponding texts inside. And when user again click xx, the row may be updated with changed text.
I caught data and made some work already.
Here is the fiddle
I’d suggest the following:
JS Fiddle demo.
Edited in response to comments from @mplungjan (below):
He’s right, of course. Therefore:
JS Fiddle demo.
References:
append().each().find().siblings().text().val().