<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script>
function changeColor(str){
var body = document.getElementById("b");
body.style.backgroundColor = str;
}
</script>
</head>
<body id = "b">
<button οnclick="changeColor('pink')">粉红色</button>
<button οnclick="changeColor('yellow')">黄色</button>
<button οnclick="changeColor('black')">黑色</button>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script>
function changeColor(str){
var body = document.getElementById("b");
body.style.backgroundColor = str;
}
</script>
</head>
<body id = "b">
<button οnclick="changeColor('pink')">粉红色</button>
<button οnclick="changeColor('yellow')">黄色</button>
<button οnclick="changeColor('black')">黑色</button>
</body>
</html>