Javascript Homework Documentation 02_28_20

I am having a bit gf trouble trying to understand the function's event, how to code them... And I am trying to understand the actual action each type of function does exactly, and what elements each function requires to work. On the body element I had two functions on there, on scroll and keypressdown and it confused the computer, but it was still performing both and when the I pressed the down key to scroll it was flashing magenta and then red which gave a cool effect, But the magenta occurs when you press ANY key, doesn't have to be the down arrow key...