Adding a click event listener in script not working
问题 I'm trying to change the color in a text box from blue to red on click, however, it's always red, the event listeners not working for some reason. function formFun() { var textBox1 = document.forms[0].elements[0]; var textBox2 = document.forms[0].elements[1]; var button1 = document.forms[0].elements[2]; var button2 = document.forms[0].elements[3]; textBox2.style.backgroundColor = "blue"; button1.style.backgroundColor = "blue"; button2.style.backgroundColor = "blue"; button1.addEventListener(