redconservatory
redconservatory

Reputation: 21934

jQuery + console (Firebug): check selector

I'm trying to use console.log("item") to find out if my selector is correct, what is the best way to go about just trying to "trace" a selector?

console.log(my-jQuery-selector);

Upvotes: 1

Views: 5015

Answers (2)

Mark
Mark

Reputation: 5720

You can also type directly in the console. For example I can write in the console:

var test = $('.myselector'); /return
test /return

and it will output the result.

Upvotes: 6

Naftali
Naftali

Reputation: 146310

try this:

 $(function() {
     var my_jQuery_selector = $('.tabs ul li'); //or any other selector
     console.log(my_jQuery_selector);
 });

Upvotes: 2

Related Questions