title: Change DIV Image Style with Javascript
body: <p>How can I change <code>#win img</code> styling with javascript? I want to change the style to: <code>max-width: 40%; max-height: 40%;</code> using javascript or jQuery.</p>
  
  <pre><code>#win img {
      max-width: 100%;
      max-height: 100%;
      width: auto;
      height: auto;
  }
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div id="win" align="center" style="width: auto; margin-top: 30px; height: auto; max-width: 80%; max-height: 80%; overflow: auto;"&gt;&lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
      document.getElementById("win").style["img"] = 'max-width: 40%; max-height: 40%;';
  &lt;/script&gt;
  </code></pre>