How to count mouse clicks? <pre><code>var number = 1; var mouseClicked = function() { </code></pre> <p>How do I make a mouseClick add +1 when the mouse is clicked? and another +1 when it's pressed again, etc etc. I'm new and have searched all over the place hoping to find this specific problem somewhere with an explanation.</p> <p>I started learning JavaScript today and am trying to create a stop light effect on 3 lights, #1 = Green, #2 = Yellow and #3 = Red. When I click I want it to advance the number and in doing so advance the color to the next light. I can't figure out how to make it add numbers though.</p> <pre><code> = 1 *mouseClick* = 2 *mouseClick* = 3 </code></pre> <p>etc, etc.</p> <p>Any help is appreciated!</p>