title: Change div width in percentage dynamically
body: <p>I have a div </p>
  
  <pre><code> &lt;div id="chart" style="position:relative; width: 100%; float:left; height: 220px;"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And I need to change width dynamically. I found solution like:</p>
  
  <pre><code>var elem = document.getElementById('chart');
  
     elem.style.width = 70 + "%";
  </code></pre>
  
  <p>But that not work's. Where I do wrong ? Thanks in advance...  </p>