2015-04-23 48 views
0

Alert(id)在表中使用時不返回任何內容。當我用「OL」標籤選擇jquery時,它會返回「li」的id,當我將「ol selectable」更改爲「table selectable」時,它會在alert消息中顯示空白。當使用jQuery UI可選擇與「ol」的表時,我需要什麼不同嗎?請建議。ui.selected在與表一起使用時返回undefined

$("#selectable").selectable({ 
    selected: function (event, ui) { 
    var id = $(ui.selected).attr("id"); 
    var color = $(ui.selected).css("border-color"); 
    alert(id); 
    } 
}); 

回答