2
我試圖用一個「on」函數執行兩個事件。我有這樣的代碼:如何在jquery中添加多個事件委託並注意
<input type="text" id="lesson" />
$('#lesson').on("focusout keyup",function(e){
var $change_education = $(this);
if(e.which === 188){
var current_value = $(this).val();
add_edit_tags(current_value, $change_education);
}
});
該keyup事件正在工作,但重點不是。我無法從網絡上看到任何解決方法。
感謝
什麼是'lesson'元素類型,你也在檢查'e.which',如果它是一個輸入類型的焦點輸出 –
,它將不會被設置。看看我的編輯 – comebal
@comebal重要的是因爲'focusout'沒有被所有元素觸發。 – alex