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

Popular posts from this blog

visual studio - vb.net filter binding source by time -

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -