I have a simple table with 5 rows. 1st row is only visible and last 4row are hidden.
<table>
<tr>
<th>sr</th>
<th>Head</th>
</tr>
<tr style="display:block;">
<td>1</td>
<td>row 1</td>
</tr >
<tr style="display:none;">
<td>2</td>
<td>row 2</td>
</tr>
<tr style="display:none;">
<td>3</td>
<td>row 3</td>
</tr>
<tr style="display:none;">
<td>4</td>
<td>row 4</td>
</tr>
<tr style="display:none;">
<td>5</td>
<td>row 5</td>
</tr>
</table>
<button id="add">Add row</button>
<button>Remove row</button>
javascript what i have try
$('#add').click(function() {
rows.show();
});
When click on add row the 2nd row should show and so no and when click on remove row it should hide the latest row and so on