title: Add height on click with javascript
body: <p>I am having a hard time figuring out how to add height to my <code>div</code>. Considering this Html :</p>
  
  <pre><code>&lt;div id='box'&gt;&lt;/div&gt; 
  &lt;div id='plus' onClick='resize()'&gt;add height&lt;/div&gt;
  </code></pre>
  
  <p>I am using this method:
   - on click i read the current height of the div
   - after that i convert the string i get to integer
   - then i add some pixels to the box height</p>
  
  <p>The JS looks like this:</p>
  
  <pre><code>   function resize() {
       //get element
  
       var height=document.getElementById('box').style.height;
  
       //transform element from string to integer
  
       height=height.replace("px","");
        height=+height;
  
        //change height
  
        var n=height;
        height=n+300+'px';        
     }
  </code></pre>
  
  <p>This should be pretty basic but i can't figure out what i'm missing.</p>