Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
179 views
in Technique[技术] by (71.8m points)

jQuery 事件绑定on的用法

$("table td").click(function(){ /*……*/ })

这种写法不能处理动态添加的“td”,所以改成下面这种:

$("table").on("click","td",function(){ /*……*/ })

但是现在需要处理一种特殊的,不需要包含某一种:

$("table td").not($(".check")).click(function(){ /*……*/ }),

现在想问的是:怎么像上面那样,把参数写进去,格式是什么样的。。。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

$('table').on('click','td:not(.check)',handler)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...