From http://api.jquery.com/on/:
.on( events [, selector ] [, data ], handler(eventObject) )
I know this might sound a little stupid, but could anyone explain the syntax here?
What does the [] mean? I would think it means that you could add several options (selectors/data) but as you can also add several events, why does events not have square brackets?
Also here's an example .on():
$(document).on("click", ".item", function() {
alert("hi");
});
Where does the data written in the method syntax come into play here?