javascript - How to print value of .hasClass via console? -


I'm trying to test if this code is working by using the Firebug console:

{$ ('# tab2'). $ (Window) .bind ("Load", function () {$ ('# tab1link'). (Function () {$ ('# tab2'). Hide (); $ ('# Tab2'). RemoveClass ('selected'); $ ('# tab1'). Show (); $ ('# tab1') addClass ('selected');}); $ ('# $ ('# Tab1'). $ ('# Tab1'). RemoveClass ('selected'); $ ('# Tab2' ). Show (); $ ('# tab2'). AddClass ('selected');});});

But this:

  console.log ($ ('# tab2'). HasClass ('selected'))  

returns error:

  Type error: $ ("# Tab 2"). There is no HasClass function {message = "$ (" # tab2 "). HasClass function is not", and ...}  

Do anyone know why the above console command is incorrect ?

Thank you!

Try refreshing the console / page, because sometimes it is correctly $ < / Code> does not specify on jQuery, assuming you are using firebug (

  warning ($ == jQuery)  

P> If this is not the case, make sure that you are not using several libraries that use $ . < / P>

Unrelated: You can change the code at $ (function () {/ * Code * /}); window load. Instead of Inding.


Comments