The operator to use for checking equality is "==". The "=" operator is used for other purposes in JavaScript and most other programming languages.
While many lines of code ought to end with a semicolon, there are some exceptions. Your semicolon at the end of the "strErrorMessage" line is fine, but the one at the end of the "if" line should be removed.