$('#arrow-left').click(function() {
var sel = $('#right option:selected').val();
$('#left').append('<option value="'+sel+'">'+ sel +'</option>');
});
The above is my code. I append an option from a selectbox #right into a selectbox #left upon click. However, I need to make sure that an option is selected in the #right or I get "undefined" options in the #left select form.
Anyone know how I can do this?