Javascript Calculator - I am having trouble using a click and mouseup/mousedown handlers on same element

Solved!

I would like to add mouseup and mousedown handlers to my calculator buttons in order to manipulate the button style to simulate a 3 dimensional button press as indicated by the 'temporary' css hover effect. I am having difficulty getting these events to fire, although the click event fires perfectly. I would appreciate it if someone would have a look at my code and point me in the right direction.

Check this:

http://www.w3schools.com/jsref/event_onmousedown.asp

Look carefully at the difference between your addEventListener code and the last example…

1 Like

Wow, thanks. I don’t know how I missed that. Its usually the simple things that can trip us up I suppose.

Took me a while and I’m on my third coffee, so it must have been near invisible :slight_smile:

1 Like