我是JavaScript的初学者,我无法理解为什么在这个简单的代码中,出现在控制台color.setAttribute不是一个函数
<style>
.red {color:red;}
.blue { color: blue;}
</style>
</head>
<body>
<p class="red">Hello World</p>
<script>
var color = document.getElementsByClassName("red");
color.setAttribute("class","blue");
</script>Run Code Online (Sandbox Code Playgroud)
在此先感谢,如果我的问题很愚蠢,那就很抱歉.