title: How can use JavaScript to set a style with !important?
body: <p>I have no problems except when trying to add <code>!important</code>. It just will not take. I need to add it in order to override a font size dynamically.</p>
  
  <p>Here is how I am adjusting the style:</p>
  
  <pre><code>function newFont(newSizeA) {
      var elems = document.getElementsByClassName('a');
      for(i=0; i&lt;elems.length; i++) {
          elems[i].style.fontSize = newSizeA + 'px!important';
      }
  
  }
  
  newFont(20);
  </code></pre>
  
  <p>With <code>!important</code> it fails, without <code>!important</code> it works.</p>
  
  <p>EDIT: This needs to work back to IE8 so I am hoping there is a cross browser solution that someone knows of.</p>