案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<body id="myid" class="mystyle">
3
4
<script type="text/javascript">
5
x=document.getElementsByTagName('body')[0];
6
document.write("Body CSS class: " + x.className);
7
document.write("<br />");
8
document.write("An alternate way: ");
9
document.write(document.getElementById('myid').className);
10
</script>
11
12
</body>
13
</html>
14