Like
$(':input[type="text"]')
versus
$(':input').is( "[type=text]" );
versus
$('input').is( "[type=text]" );
Thanks
Like
$(':input[type="text"]')
versus
$(':input').is( "[type=text]" );
versus
$('input').is( "[type=text]" );
Thanks
Take a look here: https://stackoverflow.com/questions/14863751/input-vs-input-in-jquery
input
is a DOM selector, will select all input tags. :input
is a jquery-specific selector, will include button
, textarea
, etc.
The difference is that $('.ajaxLink').on('click', function (e) { ... }
only binds elements that already exists.
$(document).on('click', '.ajaxLink', function (e) { ... }
has an delegate and also binds .ajaxLink
elements that are created dynamically in the future.
If you want an delegate you really should use a parent that is closer to the child elements than document
. The reason being that is saves unnecessary searches in the DOM tree, which gives better performance.