慕勒3428872
语法: object.className=classname示例代码:<html><body id="myid" class="mystyle"><script type="text/javascript">x=document.getElementsByTagName('body')[0];document.write("Body CSS class: " + x.className);document.write("<br />");document.write("An alternate way: ");document.write(document.getElementById('myid').className);</script></body></html>运行结果:Body CSS class: mystyleAn alternate way: mystyle