Check if the brackets match. Use the Developer tools of your browser to execute line by line when it is possible or some equivalent action. Try to learn exactly how things work --in this case, the prompt method, reading the documentation. Try the ww3schools as advised in the former answer.