Button example

In the button example, it appears to me the LED lights when the button is pushed and turns off when the button is released. What needs to be done to the code to have the LED stay on after the button is released?

I've been wrong before, and this is untested, but I believe something along the lines of the following should work although it doesn't account for button de-bounce.

enum { pinButton = 2, pinLED = 13 };
enum { OFF = LOW, ON = HIGH };
enum { UP = LOW, DOWN = HIGH };

void loop()
{
    static int stateLED             = OFF;
    static int stateButtonPrevious  = UP;

    int stateButton = digitalRead(pinButton);
    if ( stateButtonPrevious != stateButton )
    {
        if ( DOWN == stateButton )
        {
            stateLED = ((ON == stateLED) ? OFF : ON);
        } 
    }

    stateButtonPrevious = stateButton;
    digitalWrite(pinLED, ((ON == stateLED) ? HIGH : LOW));
}

void setup()
{
    pinMode(pinButton, INPUT);
    pinMode(pinLED, OUTPUT);
}