为什么,点击第一个变色按钮没反应
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
div{
width: 200px;
height: 200px;
background: yellow;
}
</style>
<script type="text/javascript">
function tored() {
document.getElementById('div1').style.background="red";
// body...
}
</script>
</head>
<body>
<input type="button" name="" value="变红" onclick="tored()" >
<input type="button" name="" value="变蓝" onclick="toblue()" >
<input type="button" name="" value="变绿" onclick="togreen()">
<div id="div1"></div>
</body>
</html>