This cannot possibly be your code, can it?
1. A comparison with no depending command like if/while etc?
2. An anonymous function inside another function that will never be called?
3. The semicolon on the first line of this code is not wrong, but highly unusual ...
4. Also in the button onclick you are only defining an anonymous function without calling anything
Bottom line: You need to learn more about functions, function references and functions calls