title: How do I subtract pixels from numbers in JavaScript?
body: <p>I need to change the height of the footer by finding out the height of another div.</p>
  
  <p>I'm using the <code>.css("height")</code> function, but I can't get the function to return the answer in pixels. </p>
  
  <p>Here's the code I'm using. It's returning <code>NaN</code>.</p>
  
  <pre><code>if($("#middleContainer").height() &gt; 500){
    var add_height = $("#middleContainer").css("height") - 500;
    alert(add_height);
  }
  </code></pre>
  
  <p>After looking at the suggestions, I'm using the following code. It doesn't make any difference.</p>
  
  <pre><code>if($("#middleContainer").height() &gt; 500){
    var add_height = $("#middleContainer").height() - 500;
    var new_height = -850 + add_height;
    alert(new_height);
    $(".footer").css("top", "new_height");
  }
  </code></pre>