The current function is operational. Upon pressing the button, it toggles between displaying "click me" and "click me again". However, I desire the button to appear blue when showing "click me" and red when displaying "click me again".
<!DOCTYPE html>
<html>
<body>
<button id="toggle" onclick="myFunction()" onclick="setcolor(blue)">click me</button>
<script>
function myFunction() {
var change = document.getElementById("toggle");
if (change.innerHTML == "click me again"){
change.innerHTML = "click me";
}
else {
change.innerHTML = "click me again";
}
}
</script>
</body>
</html>