简体   繁体   中英

Exclude a class from fired event jquery

I have a table that has on keyup events being fired if the dynamically generated inputs are modified but i would like to exclude certain classes of input in the table row from the events, I have tried two options and both have failed

$(document).on('keyup', '.tg > tbody > tr:not(.pd1)', function() {});
$(document).on('keyup', '.tg > tbody > tr:not(".pd1")', function() {}); //added quotes to pd1 class

sugestions!

而不是将事件注册到tr,使用输入

$(document).on('keyup', '.tg > tbody  input:not(.pd1)', function() {});

Arun assumes the class pd1 is on the input and not the tr like the question suggests. if the class pd1 is on the tr then:

$(document).on('keyup', '.tg > tbody > tr:not(.pd1) input', function() {});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM