What does it mean when you get the error; Illegal use of the resevered word; else.

   if(); 
    {
    alert();
    } else {
    alert();
    };

Why is there a semicolon at the end of line 1?

The semi-colon on line 1 is not the correct sytax for an if/else, so when the compiler gets to line 4 it does not see it as a valid else

thanks :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.