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: 
here you go [http://jsfiddle.net/6KfHy/1/]

```
var baseWidth = 90;
var stepWidth = 4;
var baseHeight = 20;
var growHeightPerStep = 1;

function changeHeight() {
    var windowW = $(window).width();
    var diffWidth = windowW - baseWidth;
    var diffHeight = parseInt(diffWidth / 4, 10);

    $('.grow').css('height', baseHeight + diffHeight + 'px');
}

changeHeight();

$(window).resize(function() {
    changeHeight();
});

```
```
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 :)