我有一个选择菜单,我试图绑定一个点击功能,并能够获得选择选项值属性的变化。我如何获得jQuery的选择菜单的值更改
select = $('#select_networks').selectmenu();
//bind the change of network/group
select.bind("change", function(event, ui) {
//need to figure out the selected elements value attribute
});
这引起了值正常,但跟进的问题。我怎样才能拉任意属性。例如,我在select选项中设置了一个类型字段,我尝试了alert($(this).attr(“type”));但我只是不确定。 – Brian
更新了代码。 –