Possible Duplicate:
Creating a CSS class in jQuery
$("< style>span{color:red}< /style>");
jQuery < span>jQuery< /span> jQuery
Heh, interesting idea.
This works if you insert the element into the DOM:
$('head').append($("<style>span{color:red}</style>"));
jsFiddle
Dynamically fiddling with CSS usually has some side effects, but this should okay: It works fine even in IE6.
$("<style>span{color:red}</style>").appendTo('head');
?
精彩评论