<style type="text/css">
div{
width:100px;
height:100px;
background-color:tomato;
}
.active{
width:100px;
height:100px;
background-color:skyblue;
}
</style>
</head>
<body>
<div></div>
<script type="text/javascript">
var div = document.getElementsByTagName("div")[0];
div.onclick = function(){
// 2.4.1
div.style.width = "200px";
div.style.height ="200px";
div.style.backgroundColor="green";
// 2.4.2改变class
div.className="active";
}
</script>
</body>
</html>