How to view DOM element when console.log jquery object in webkit How to view DOM element when console.log jquery object in webkit google-chrome google-chrome

How to view DOM element when console.log jquery object in webkit


This should do it for you:

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

The reason being jQuery wraps elements in an array, so you need to access the actual element via an array index.

Or click the little triangle to the left to expand the output so that you can interact with the elements that are printed out.


For Drupal objects, or for other frameworks which don't use $, use the following:

console.log(jQuery('body')[0]);

OR (with the old syntax):

jQuery('body');