Create dynamic inline stylesheet
<p>What is the best way of creating dynamic style tags using js and/or jQuery?</p>

<p>I tried this:</p>

<pre><code>var style= jQuery('&lt;style&gt;').text('.test{}');
</code></pre>

<p>This works in FF but pops an error in IE7 "Unexpected call to method or property access."</p>

<pre><code>var style = document.createElement('style');
style.innerHTML='.test{}';
</code></pre>

<p>Gives the same error. It doesn't matter if I use <code>innerHTML</code> or <code>innerText</code>. The strange thing is that it shows an error before appending the style tag.</p>

<p>I suspect that <code>cssText</code> has something to do with it, but I'm not sure how.</p>
