Add A Row using JQuery

Add A Row using JQuery

I'm new php and javascript and am trying to edit an already created form.  The number of rows in the form is currently hard coded.  Example php for 7 rows:

for ($i=0;$i<7;$i++)

Is there away using php and JQuery to set the default value to 3 rows and onClick on plus image change from $i<3 to $i<4.  And onClick on minus image change from $i<4 to $i<3.

I would like to store the number of rows in the database, so after I submit the form, I can return to update it and the correct number of rows is shown.