The semicolon in Javascript is used to end a statement. So with the semicolon at the end of the if statement you are already closing the if statement. So no matter what the condition in the if statement is, the next line(s) will always be executed.
This is the correct syntax for a simple if statement (one statement)
Code:
if(condition)
statement;
This is the correct syntax for an if statement that should include more than one statement
Code:
if(condition) {
statement1;
statement2;
...
}