我有一個選擇菜單,我試圖綁定一個點擊功能,並能夠獲得選擇選項值屬性的變化。我如何獲得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
更新了代碼。 –