Javascript onload event to resize image help
<p>This might be a simple one for you guys, im learning Javascript and have hit a problem. I am trying to have the script resize a particular image on the page when onload is called like so:</p>

<pre><code>&lt;script type="text/javascript"&gt;

 function resizeSampleImage()
 {
  document.getElementById("sampleImage").style.height = (document.body.clientWidth) * 0.2;
 }

    &lt;/script&gt;
</code></pre>

<p>...</p>

<pre><code>&lt;body onload = "resizeSampleImage();" &gt;
</code></pre>

<p>...</p>

<pre><code>&lt;a href="http://www.buildingpeople.uk.com" target="_blank"&gt; &lt;img id="sampleImage" src="Images/BP snip.jpg" alt="BuildingPeople.uk.com" /&gt; &lt;/a&gt;
</code></pre>

<p>apologies, forgot to mention that is doesn't work! after loading the page in multiple browsers the image stays it native size and the error consoles say they fail to parsing value for height. Declaration dropped.</p>

<p>I have tried lots of different ways but cannot seem to get it to work.</p>
