How to change background color (green/red) in empty HTML on certain keys?
P粉211273535
P粉211273535 2023-09-07 10:08:19
0
2
378

Does anyone have a solution on how to change the background color in HTML when certain buttons are pressed, for example the letter A. Whenever I press the button, the color switches to another color (red to green, or green to red) and stays that way. But the good thing is that it works when I'm not focused on the web browser, so it also works when I'm using other apps through the browser. Sorry for the noob questions and language barrier. thank you for your reply.

Similar to this link, but should be on the key: How to change different background color using only one button

P粉211273535
P粉211273535

reply all(2)
P粉345302753

You can use JavaScript to detect key events and change the background color



  
    
    Change background color on keypress
  

Press the 'A' key to change the background color!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!