One of the developers I work with began to write all his code this way:
$('.toggles').delegate('input', 'click', function() {
// do something
});
vs:
$('.toggles').click(function() {
// do something
});
Are there any performance benefits to doing this?
delegate()is superseded as of jQuery 1.7.Use
.on()instead..on()has excellent performance benchmarks. And covers your.click()needs as well as needed