Hey guys ,

While playing with jquery i've come across the following situation :

$(document).ready(function(){

	$("div")[0].css("background-color","blue");
});

I get an error everytime i try to call any method on a particular element from the wrapper set .

I tried with the get()

$("div").get(0);

Same stuff .

I can't spot what the problem is .

Thank u

I found out what the problem is .

When getting an element from the wrapper set ( by index array notation or by get(index ) ), it returns a javascript element , NOT a jquery object and thus everytime i try to call a method from the jquery library on the extracted javascript element i get an error like ( " method name is not a function " ).

The solution to my problem :

$(document).ready(function(){

$("div:first").css("background-color","blue");

});

I hope this topic will help others that ran over the same problem .

Many thanks to redsquare from the jquery irc channel for all the help .

This question has already been answered. Start a new discussion instead.