下面的代码适用于 value( B) inselect#B但不适用于 variable( $index) in select#index。实际上,我需要id成为一个变量,并希望一个 jQuery 函数对该变量进行操作。
jQuery函数:
$(function(){
$('select#B').change(function(){
var this_value = $(this).val();
$('input#seleted_value').val(this_value);
});
});