Greetings. I had an idea for a webpage game I thought would be easy to create. I thought that since I had never built a website, done any programming or used a Windows computer before. (Insert humble smily here) I’d spent the last 12 years using Macs. The last 5 months of research and study has given me an appreciation of what you folks know.
Input for my game looks like a simple JS calcuator without the math function buttons. I created a keypad with numbers from 1 to 55 on 55 buttons. Game play I am trying to create; Keyboard is neutral color at the start. Onclick, the first time, it would turn the selected button green and insert that number into a form or array of positive integers. Onclick second time, button on the keypad turns from green to red and shifts that number into a display of negative integers. Onclick 3 it returns to neutral color and removes the number from the display. The color change is to let players know which numbers have already been selected. No number can be used twice. Each display/array is limited to 5 of the 55 integers. Numbers will be downloaded into a MySQL database then scored.
I have seen tutorial sites with code to change background color of a page onclick. Is there a way to make a button change color onclick? Alternative would be to have just the digit on the button change color onclick by changing font color if that is possible.
Thanks for any feedback or suggestions. DocFont