I know about jquery .on() use and purpose, because I use it.
But I want to know what is the difference between $(document).on()
vs $(element).on()
in this script:
<html>
...
<body>
...
<table id="table-user">
<thead>...</thead>
<tbody>
AJAX DYNAMIC CONTENT
</tbody>
</table>
....
<script>
$(document).on('click','.btn-edit',function(){
go_edit();
});
$('#table-user').on('click','.btn-edit',function(){
go_edit();
});
</script>
</body>
</html>
is any performance different or something else between them?