javascript - $(':checkbox') or $('input[type="checkbox"]') -
which method best select checkbox using jquery , why?
$('input:checkbox'); // 1 $('input[type="checkbox"]'); // 2
well, according jquery docs:
because :checkbox jquery extension , not part of css specification, queries using :checkbox cannot take advantage of performance boost provided native dom queryselectorall() method. better performance in modern browsers, use [type="checkbox"] instead.
Comments
Post a Comment