有道假設我有一個.on()
函數其中i選擇多個ID是存在於多個選擇器迭代中的jquery
$("#i, #am, #your, #father").on("click" , function(event){
//iterate over the selectors and return tagname
alert ($("#i").prop("tagName") );
alert ($("#am").prop("tagName"));
alert ($("#your").prop("tagName"));
alert ($("#father").prop("tagName"));
}
,我可以想到的是分別提醒每一個的唯一方法。有沒有一種已知的方法將$("#i, #am, #your, #father")
作爲一種數組來處理?
不會'警報($(本).prop( 「變量名」));'應該做要緊? –