how to change the width of the element that has been append to body
hi , i have a div element that i have been added it to the body with append method .
var container_style = "<style> #container3{width:800px;background-color:#f0f0f0;position:absolute;z-index:1004;top:100px;left:19%;padding:20px;border-radius:3px;;box-shadow:0px 0px 20px 1px #242424}</style> ";
var fortest = "<div class='senfi' id='container3' ></div>";
$('body').append(fortest);
//________________________________________________________
okay now i want to change the width of this element if i change the window width (resizing)
im using this code but nothing w'll happen.
$(window).resize(function(){
$('container3').css('width','600px');
});
its not working , i dont know why