获取特定选择的id /值

时间:2013-03-12 19:09:29

标签: jquery select option

var tester = $("select[name='SELECTNAME']").attr('id');

任何人都可以告诉我获取特定ID /值的正确方法是什么 选择?

谢谢。

1 个答案:

答案 0 :(得分:1)

$("select[name='SELECTNAME']").change(function() {
  var id = $(this).children(":selected").attr("id");
});
相关问题