How do I console.log a jQuery DOM Element in Chrome? How do I console.log a jQuery DOM Element in Chrome? jquery jquery

How do I console.log a jQuery DOM Element in Chrome?


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)})​


console.log($(...)[0]);

is another way