I'm pretty new to jquery and I encountered a problem. I use $() to make a variable a jquery object. But somehow, it does not fully work as expected (I'd expect it can access to all jquery methods for that object). Here is what I did:
$(function() {
var form = "<div id='menu-box'></div>";
$(form).appendTo('body').css({'backgroundColor': 'blue'}); // this line works
$(form).css({'backgroundColor': 'red'}); // this line does not.
});
I'm using jquery-1.9.1, is it a bug or I did something wrong.