求这样到一个插件,就是写好样式输出到对应元素到style上
eg:
<style>
.foobar { background: #fff; }
</style>
<div id="a" class="foobar"></div>
<div id="b" class="foobar"></div>
<!-- 转换为 ↓↓↓ -->
<div id="a" class="foobar" style="background: #fff;"></div>
<div id="b" class="foobar" style="background: #fff;"></div>
不知道你为什么要这样做、使用css是为了让浏览器缓存和更好的维护、输出到style中反而增加了这些问题