What does delegation do versus a plain on('click',…)?
问题 What is the different in performance and the handling of these two different jQuery statements: Number One : $('#selector1, #selector2, .class1').on('click', function () { //stuff }); Number Two : $(document).on('click', '#selector1, #selector2, .class1', function () { //stuff }); I know that one does delegation and the other doesn't. But what does that mean? Don't both do some sort of action when you click on '#selector1, #selector2, .class1' ? In the end, isn't it the same? 回答1: Number One