title: Dynamically assign height to a div
body: <p>I want to do this: <code>&lt;div class="container" style="height: calc(100vh - 349px);"&gt;</code> but dynamically through JavaScript because the "394" will vary.</p>
  
  <p>I did this:</p>
  
  <pre class="lang-js prettyprint-override"><code>&lt;script&gt;
          var afooter = document.getElementById('footer').positionInfo.height;
          var acontainer = document.getElementById('container').positionInfo.height;
          var dif = parseInt(acontainer) - parseInt(afooter);
          document.getElementById('contenedor').setAttribute('style','height: calc(100vh -' + dif + '');
  &lt;/script&gt;
  </code></pre>
  
  <p>What I am doing wrong?</p>