title: How can I create alike css classes
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1720320/how-to-dynamically-create-css-class-in-javascript-and-apply">How to dynamically create CSS class in JavaScript and apply?</a>  </p>
  </blockquote>
  
  
  
  <p>I want to create css classes depending upon what user has specified a width in a textfield. I know I can do it using inline styles, but I want to avoid it as there are many properties to be taken care of. In this question "width" is just an example.</p>
  
  <p>For eg: if user specifies width as "20" then I want -</p>
  
  <pre><code>.w20 {width:20px}
  </code></pre>
  
  <p>if user specifies 21 then I want</p>
  
  <pre><code>.w21 {width:21px}
  </code></pre>
  
  <p>and so on...</p>
  
  <p><strong><a href="http://jsfiddle.net/ashwyn/qGmsP/" rel="nofollow noreferrer">FIDDLE</a></strong></p>
  
  <p>Thanks.</p>