+ 1
JQuery.css() not working...
I have JQuery ready to use... it's working , It creates my element.. But , For some reason when i try to modify my "div" css no change is made.. Any help? code: player=$('<div id="p1" class="p1">hi</div>'); $("div").css({"width" : "25px", "height" : "25px", "background-color" : "#000"}); $("body").append(player); I've tried ("div").css as well as (".p1").css ... Neither of them work..
2 Answers
+ 1
Try to give css after appending the 'player'. I think css function affects only existing elements.
+ 1
Thank You!