Insert dynamic row in table using jquery

In this tutorial,I will show how to insert dynamic row in table using jquery.
dynamically add row in table using jquery is very simple as jQuery provides clone() function to clone HTML elements. Using this function we can clone a row and add this row to table using insertBefore() function.

For adding dynamic row in table, we have used insertRow() and clone() method.
<title>Add row dynamically using jquery</title>
   <script src=""></script>
   //addRow():This is very simple javascript function using jQuery library for adding dynamic html table row on user click.
function addRow(){
    $('#table_id tr:last').clone(true).insertAfter('#table_id tr:last');
   $('#table_id tr:last input').val("");
   $('#table_id tr:last input:first').focus();
<table id="table_id" width="100%">
             <td >Name :</td>
              <td >
<input type="text" name="name" value="name" />
<br />
<a href=javascript:void(0);  onclick="javascript:addRow()">Add Row</a>