I'm trying to set the select option back to the "choices" every time I finish adding a new row. How can I do it here? Please help. Btw, adding new row(s) works just fine. Here is what I've got so far:
$(document).ready(function() {
$('#Add-btn').live('click',function() {
$("#tabName tr:last").before("<tr><td class='greyed'><input type='hidden' name='allele' value='" + a + "'>" + a + "</td><td><input type='button' class='delete' value='Remove'></td></tr>");
});
});
HTML:
<table id="tabName">
...
<select size='1' id="a" name='a'>
<option value="None" selected>choices</option>
<option value='1'>first</option>
<option value='2'>second</option>
</select>
...
</table>
<div>
<input id="Add-btn" class="button" type="button" value="Add" />
<span></span>
</div>