The first:
$(document).on('click', '#mySelector', function() {
will trigger every time you click on a document, and then run the function on the #mySelector element only when the click happened on a #mySelector.
The second:
$('#mySelector').on('click', function() {
will trigger only when you click directly on the #mySelector object.
For this example, where you are using an id, there isn't much difference, except for one very useful thing. If you use the first syntax, you can remove the #mySelector object and bring it back, or attach it at a later point and it'll start working right away.
With the second syntax, when you remove the #mySelector object, you will also remove the event, which means it has to be remade when you reattach the #mySelector object.
This is even more useful when using a class:
$(document).on('click', '.clickme', function() {
This will automatically have every object with a class of 'clickme' that is inside the document respond to the event. More 'clickme' objects can be added and they will function just fine without having to set up the event everytime.