title: How To Get Font Size in HTML
body: <p>I was reading a question on here trying to get the font size of a text.  The answer they gave was to get the pixel size using a measure method.  All i want to be able to do is get the font size value so i can change it.</p>
  
  <p>For example:</p>
  
  <pre class="lang-js prettyprint-override"><code>var x = document.getElementById("foo").style.fontSize;
  document.getElementById("foo").style.fontSize = x + 1;
  </code></pre>
  
  <p>This example does not work though these two do</p>
  
  <ol>
  <li><code>document.getElementById("foo").style.fontSize = "larger";</code></li>
  <li><code>document.getElementById("foo").style.fontSize = "smaller";</code></li>
  </ol>
  
  <p>The only problem is that it only changes the size once.</p>