js 简单的样式封装

<script>
function test(value){
var str=value;
document.write("<div style=\"width:100px;height:100px;background:red\" >");
document.write(str);
document.write("</div>");
}
</script>
<script>
test(123);
</script>

 

posted @ 2015-09-06 11:47  fleam  阅读(323)  评论(0)    收藏  举报