<style type="text/css">
.xx{ width:200px; height:200px; background-color:#FFFF99}
</style>
<body>
</body>
<script>
var div = document.createElement("div");
if(document.all)
{div.setAttribute("className", "xx")}//for IE
else
{div.setAttribute("class", "xx");} //for firefox
document.body.appendChild(div)
</script>