I used to be able to do console.log(somejQueryObj);
and it logged in an array all of the DOM elements that are in the object that I could click and go to the inspector.
Now it does something like this:
[prevObject: p.fn.p.init[1], context: , selector: ".next ()"]
which can confuse many people.
How do I make it so that Chrome logs how it used to log jQuery elements?
Here is a fiddle example
I am in:
Google Chrome 23.0.1271.97 (Official Build 171054) m
Update: I made a jQuery plugin to bring back the old style logging: jquery.chromelog.
You could create a little function to log all elements on one line:
$.fn.log = function() {
console.log.apply(console, this);
return this;
};
Usage:
$("...").log();
To do it for each element so that you can hover over it, try something like this:
$("div").each(function(){console.log(this)})
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