Question: ```
#footer {
    height: 70px;
    background:url('../image/footerImg.gif'); 

}

```

My jQuery code: 

```
$(document).ready(function(){
    var h=$(window).height();  
    var w=$(window).width();  
}); 

```

Now I want to assign the width of `background:url('../image/footerImg.gif');` as `'w'(var w=$(window).width();)`. How can do this?

Answer: 
Try this:

```
var h = $(window).height();
$('#footer').height(h);

```
Since you have mentioned about css property on background image, i assume you are looking at [background-size](https://developer.mozilla.org/en-US/docs/CSS/background-size)

You can do this:-

```
$(document).ready(function(){
   var h=$(window).height() + "px";  
    var w=$(window).width() + "px";  
    $('#footer').css({"background-size":  w + " " + h });
});

```