title: Increase/Decrease Font Size Script - How Add Default Text Size Function?
body: <p>Does anybody know how to modify the below script so that, in addition to the two current functions (changeFontSize( id, true); //Increases the font size - changeFontSize( id ); // Decreases size), I can add a third function whereby the font size will be reset to a default setting?</p>
  
  <p>Thank you, Chris</p>
  
  <p>SCRIPT</p>
  
  <p>function changeFontSize( objId, doIncreaseSize ) {
  //Define your variables before use, or they will become global.
      var currentSize = 0, 
          obj = document.getElementById( objId ), 
          newVal = 0, 
          limitMax = 10, 
          limitMin = 0.5, 
          unit = 0.1; </p>
  
  <pre><code>if( !obj ){
   return false; //Avoids errors if obj isn't found.
  }
  currentSize = parseFloat( obj.style.fontSize );
  if( doIncreaseSize ){
      unit = -unit; // unit becomes negative. This turns subtractions into addition.
  }
  newVal = currentSize - unit;
  if( limitMax &gt;= newVal &amp;&amp; limitMin &lt;= newVal ){
      obj.style.fontSize = newVal + "em";
  }
  </code></pre>
  
  <p>};</p>