I have an input field ( source languages ) which i want when i click on one of the source languages, the target language with the same text is disabled
I done that so far but it keep disable the target languages when i click the source language
what i want to reset that every time .. not to make always listen to event
here is the demo http://jsfiddle.net/ezNxU/
// change the target language according to the source language
$('#source').change(function () {
var option_source = $('select#source option:selected').text();
$('select#target option').each(function () {
if ($(this).text() == option_source) $(this).prop("disabled", true);
console.log($(this).text());
});
});