我.on()在jQuery 1.7中使用过,并想知道是否可以为已经注入页面的元素一次附加多个选择器.以前,我正在使用live()- 但很明显,为什么我想要改进性能.
你能.on()以这样的方式使用:
$(document).on('click', '#selector1, #selector2, .class1', function () {
//stuff
});
Run Code Online (Sandbox Code Playgroud)
附加到文档中是否有任何好处?
?