Edit value of n number of <td> using jquery or javascript [on hold]
- by Yousaf
Hello Guys I am trying to edit the value of n number of td but i am onlt able to edit 1 value how can edit n number of tds i dont know how many rows could be in table
here is my current code i want to do it dynamically
HTML
<input type="text" name="editValue" id="editValue" value="" />
<br>
<table id="testing">
<tr>
<td id="tdid">Value1</td>
<td><a href="#" id="button" >Edit</a></td>
</tr>
<tr>
<td >Value2</td>
<td><a href="#">Edit</a></td>
</tr>
</table>
Jquery
$("#button").on('click', function(){
var r = $("#tdid").text();
$("#editValue").val(r);
});
Here is working example
http://jsfiddle.net/M5Gkb/6/