I´m testing the length property which returns this error:
$("div.rows").children().length is not a function
var count = $('div.rows').children().length();
$('div#header').html(count);
When i use .size(); it does show me a value, which is 0, which is still wrong but at least it doesn't return an error.
I'm pulling my hair out over this one. Any ideas?
I´m testing the length property which returns this error:
$("div.rows").children().length is not a function
var count = $('div.rows').children().length();
$('div#header').html(count);
When i use .size(); it does show me a value, which is 0, which is still wrong but at least it doesn't return an error.
I'm pulling my hair out over this one. Any ideas?
Share Improve this question asked Jun 17, 2011 at 19:46 Xorp25Xorp25 631 silver badge3 bronze badges 1- api.jquery.com/length – Felix Kling Commented Jun 17, 2011 at 19:50
1 Answer
Reset to default 17It's not a function, it's a numeric property, so lose the last ()
pair:
var count = $('div.rows').children().length;