$('#select_id1, #select_id2, #select_id3').change(function() {
// If '#select_id1' has changed, 'str' should be equal to 'select_id1'.
// If '#select_id2' has changed, 'str' should be equal to 'select_id2'.
// If '#select_id3' has changed, 'str' should be equal to 'select_id3'.
str = <what should be here ?>
});
Run Code Online (Sandbox Code Playgroud)
您可以获取调用更改的元素的ID this.id.
$('#select_id1, #select_id2, #select_id3').change(function() {
str = this.id;
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
213 次 |
| 最近记录: |