<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<style type="text/css">
div.hover{ font-size: 44px; color: #f00;}
</style>
</head>
<body>
<script type="text/javascript">
window.onload=function () {
var allDiv=document.getElementsByTagName("div");
var len= allDiv.length;
var lastDiv=allDiv[len-1];
lastDiv.className="hover";
}
</script>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</body>
</html>本回答被提问者采纳