I am currently using Javascript like so:
$(button).css("background-color", color1);
$(button).css("background-color", color2);
I would like to add event handlers to the button element, so that I would be able to keep track of times that the button colours were changed, that is every time the button is set to color1, the time is kept, and also the time when the button is set to color2. Does anyone know how to do this please, because I can't seem to find the right event handler for this?