Question: First of all, sorry for bad english.

Well, I need to change the color property of all parragraphs, using javascript, here's my html&JS code:

```
<body>
<p>Parragraph one</p>
<p>Parragraph two</p>
<button onclick="CE()">change style</button>
</body>

for (var j=0;j<document.styleSheets[0].cssRules.length;j++) {
  if(document.styleSheets[0].cssRules[j].selectorText='p')
    document.styleSheets[0].cssRules[j].style.color="#FF0000";
}

```

And this is my CSS code:

```
p{
    color: green;
    font-size: 20px;
    font-weight: bold;
    font-family: arial;
}

```

I tried to change it with this too: `document.styleSheets[0].cssRules[0].style.backgroundColor="#FF0000"`;
(trying to change the background color, just to see if it works, but only works on Mozilla Firefox)

Answer: 
Try this

```
$(window).resize(function() {
    var bodyheight = $(document).height();
    var divHeight = (bodyheight-10)/2;
    $('.grow').css("height", divHeight+"px");;
});

```
```
var $grow = $('.grow'),
    $window = $(window);
$(window)
    .resize(function () {
        var windowWidth = $window.width();
        if (windowWidth > 90) {
            $grow.height(~~ (windowWidth / 4));
        }
    })
    .resize();

```

Trigger it the first time on dom ready.

<http://jsfiddle.net/techunter/Xug5A/>

remark careful with `.grow` margins and paddings :)