title: javascript beginner: add a dynamic style in javascript?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/524696/how-to-create-a-style-tag-with-javascript">How to create a &lt;style&gt; tag with Javascript</a>  </p>
  </blockquote>
  
  
  
  <p>I write a dynamic form using java-script. I want to add the style in java-script itself. I write some code to add a style. But it is not working.This is the code am write in my project.</p>
  
  <pre><code>var sheet = document.createElement('style');
  sheet.type="text/css";
  sheet.innerHTML = "body{color:red;}";
  document.body.appendChild(sheet);
  </code></pre>
  
  <p>Anyone help me please.</p>