Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
var tester = $("select[name='SELECTNAME']").attr('id');
谁能告诉我获取特定选择的 id / 值的正确方法是什么?
谢谢你。
$("select[name='SELECTNAME']").change(function() { var id = $(this).children(":selected").attr("id"); });