diff --git a/Change_Color_Background/js/script.js b/Change_Color_Background/js/script.js index ea46b78..750a2e7 100644 --- a/Change_Color_Background/js/script.js +++ b/Change_Color_Background/js/script.js @@ -7,6 +7,6 @@ body.style.backgroundColor = 'violet' button.addEventListener('click', changeBackground) function changeBackground(){ -const colorIndex= parseInt(Math.random()*colors.length+1) +const colorIndex= parseInt(Math.random()*colors.length-1) body.style.backgroundColor = colors[colorIndex] }