StackOverflow : Insert row after row javascript

http://stackoverflow.com/questions/26000626/insert-row-after-row-javascript/26000842

by Nicolas Escoffier

HTML

<body>
    <table>
        <tr><td>test #1</td><td><a href="#">Here we go1!</a></td></tr>
        <tr><td>test #2</td><td><a href="#">Here we go2!</a></td></tr>
        <tr><td>test #3</td><td><a href="#">Here we go3!</a></td></tr>
    </table>
</body>

JavaScript

$(document).ready(function(){
    $('body').on('click','table a', function(e){
        $(this).closest('tr').after('<tr><td>New Content 1</td><td><a href="#">New Content 2</a></td></tr>');
    });
});