How To set Add Row On Click To last Column3 column
Here Is Example http://jsfiddle.net/83aqdd62/8/
http://jsfiddle.net/83aqdd62/8/ Here Example
<table id="sampTable">
<thead>
<tr>
<td>Column 1</td>
<td>Column 2</td>
<td>Column 3</td>
</tr>
</thead>
<tbody>
<tr>
<td><input type="text"/></td>
<td><input type="text"/></td>
<td><input type="text"/></td>
</tr>
<tr>
<td><input type="text"/></td>
<td><input type="text"/></td>
<td><input type="text"/></td>
</tr>
</tbody>
</table>
Jquery
$('#sampTable tr td:last-child').on("click",function(){
addRow();
});
function addRow(){
$sampleRow = $(' <tr> <td><input type="text"/></td><td><input type="text"/></td> <td><input type="text"/></td></tr>');
$sampleRow.find("td:last").click(function(){
addRow();
});
$('#sampTable tbody').append($sampleRow);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.