为什么这不起作用?
<script>
$(document).ready(function(){
$('#custom_field option').click(function(){
$('#custom_field_input').append('<tr><td></td></tr>');
$('#custom_field_input td:last').append($(this).find(":selected").text());
});
});
</script>
我发现有一个 .change 函数,它可以工作,但与我无关,因为即使选择下拉列表的值没有变化,我也需要附加文本。
意义。
用户单击 option1,附加 option1 文本。
用户再次单击选项 1,附加了另一个选项 1 文本。