JSFiddle - React, Tailwind, and code Playground
HTML
<div id="a-opt">
<table id="tabName">
<tr>
<td>
<select id="a" name="a">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" style="background:transparent;"><input id="Add-btn" class="button" type="button" value="Add" /><span></span></td>
</tr>
</table>
</div>
JavaScript
$(document).ready(function() {
$('#Add-btn').live('click',function() {
$(document.body).append($("<div>"));
var a = $('#a').val();
$("#tabName tr:first").before("<tr><td class='greyed'><input type='hidden' name='added_a' value='" + a + "'>" + a + "</td><td style='background:transparent;'><input type='button' class='delete' value='Remove'></td></tr>");
$("#a option:selected").attr("disabled", true);
});
$('#tabName td .delete').live('click',function() {
// here I want to re-enable the select option ...removeAttr('disabled');
$(this).parent().parent().remove();
return false;
});
});