<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
function changeColor() {
let arrColor = ["red", "orange", "yellow", "green", "blue"];
let arrNum = Math.floor(Math.random()*arrColor.length);
let tag = document.getElementById("theBody");
tag.style.backgroundColor = arrColor[arrNum];
}
</script>
</head>
<body id="theBody">
<button onclick="changeColor()">배경 색상 바꾸기</button>
</body>
</html>
