Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see/display/debug the selected dom nodes with jquery?

Tags:

jquery

Is there any good way to see/debug the result of a jQuery selector ?

Let's say we have something like this

var arr = $('div > span').parent();

How can I see what the selector contains?

Update

Just to make this a bit harder: Can I do the same in http://jsfiddle.net/ ?

like image 721
johnlemon Avatar asked Apr 06 '11 19:04

johnlemon


1 Answers

in firebug or chrome console do:

console.log($('div > span').parent());
like image 176
Naftali Avatar answered Nov 15 '22 03:11

Naftali