title: Css code in javascript function
body: <p>I have this javascript method:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
     function MyFunction(sender, eventArgs) {
         if (someCondition) {
             //css
         }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>The css code I want to be executed is:</p>
  
  <pre><code>&lt;style type="text/css"&gt;
            .classInsideTheClassWhichEntersTheIf
            {
            background: url(Images/myImage.png) !important;
            }
  &lt;/style&gt;
  </code></pre>
  
  <p>but only for those cells that enter the if condition above. If I write it outside it works but for every cell. Is something like this possible? If yes, how to do it?</p>