Latest web development tutorials

jQuery miscellaneous size () method

jQuery Misc Methods jQuery Misc Methods

Examples

Output is jQuery selector matches the number of elements:

$("button").click(function(){
alert($("li").size());
});

try it"

Definition and Usage

size () method in jQuery version 1.8 is discarded . Please use the length property instead.

size () method returns the number of matched jQuery selector element.


grammar

$(selector).size()


jQuery Misc Methods jQuery Misc Methods