I have following table structure.
<table>
<tr>
<td><a href="#"></td>
</tr>
</table>
When I click on <a> I want to add new <tr> next to <tr> of which <a> is clicked.
So the result will be:
<table>
<tr>
<td><a href="#"></td>
</tr>
<tr>
<td><a href="#"></td>
</tr>
</table>
Example:
If you want to create a clone use:
Example link: http://www.jsfiddle.net/7A6MQ/
Basically, you create a copy from the
tr element(which includes child nodes) and insert that copy after that element. Therefore, you need the.livebinding to make sure that newly createdaelements do also invoke that click handler.Ref.: .clone(), .insertAfter(), .live()