In my Java Script, I am using a select tag to select multiple values one after the other,
My requirement is passing this newly selected value to a function.
Everything works perfect with jQuery on Change function, but when I deselect the item from the list still it taking the item and passing it to function.
How can I clear this problem?
$("#clients").off('change').on('change', function(){
selectedclientname = $(this).closest('select').find('option').filter(':selected:last').text();
selectedclientid = $(this).closest('select').find('option').filter(':selected:last').val();
function1(selectedclientid);
});
Finally I figure it out by the following way