$ ("div.rows"). children (). length is not a function

I am testing the length property, which returns this error:

$ ("div.rows"). children (). length is not function

var count = $('div.rows').children().length(); $('div#header').html(count); 

When I use .size (); it shows me a value that is 0, which is still not the case, but at least it does not return an error.

I pull my hair on top of it. Any ideas?

+6
source share
1 answer

This is not a function, this is a numerical property, so lose the last pair () :

 var count = $('div.rows').children().length; 
+16
source

Source: https://habr.com/ru/post/890785/


All Articles