JSFiddle - React, Tailwind, and code Playground
by Manan Patel
HTML
<select name="attribute_taxonomy" id="attribute_taxonomy" class="attribute_taxonomy">
<option value="">Custom product attribute</option>
<option value="pa_bedroom">Bedroom</option>
<option value="pa_bathroom">Bathroom</option>
</select>
<button type="button" class="button button-primary add_attribute">Add</button>
JavaScript
$('.add_attribute').on('click', function () {
var selected = $('#attribute_taxonomy option:selected');
alert(selected.val());
});