Sometimes I use jquery to test my css. And often I'll use a simple selector (in the Chrome Web Developer console)
I'll type in something like $('.topclass div')
and get back
e.fn.e.init[125]
As a javascript object
containing nodes. (Usually its quite a complex selector but sometimes its simple).
Why do I get this? Does it mean a tag is missing or my selector is wrong?
Edit: The html is basically nested divs (could it be because its getting its children divs too?)
It means your selection contains too many matches, and the developer tools shorten their representation in the console.
Try this in the console:
var a = []
for (var i = 0; i < 10; i++) { a.push('foobar'); }
If you try to inspect a
, you will see ["foobar", "foobar", "foobar", "foobar", "foobar", "foobar", "foobar", "foobar", "foobar", "foobar"]
. Now, add some more elements:
for (var i = 0; i < 100; i++) { a.push('foobar'); }
Now, if you try to inspect it, you will see Array[110]
.
Does not inherently mean your selector is wrong, but if you're expecting fewer elements, then it might be wrong.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With