我有一个输入字段(源语言),当我点击其中一种源语言时,同样文本的目标语言被禁用选择相同的输入时禁用输入字段?
我做到目前为止,但它保持禁用目标语言时我点击源语言
什么,我想重置,每次..不作总是听事件
这里是演示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());
});
});
绝对是最好的! – 2013-03-27 13:24:02
最好简单的感谢 – osos 2013-03-27 13:34:57