I've been fiddling with programming from time to time for few years and have decided to give it a proper go with some simple, personal projects. I'm trying to make a randomizer for a pen and paper RPG that samples from an array an option at random and displays it to the user, rolls dice, and simulates fights based on chosen stats, among other things.
I can't for the death of me figure out where the error is in this section I'm currently working on. The player chooses a dice value to roll from the drop down select element, presses throw button and the page displays the randomized result in H1. This works. What I'm struggling with now is how to add an if else functionality into the code that decides if the selected value is a six (so basically your regular, run-of-the-mill dice) or not. This is because six-sided dice are important in the system we are using so I want to display more than one roll if the player decides to choose the "six" option.
I took the code out from the throw function and simply tried a simple snippet of code of setting a var and using an if else to do either this or that whether the value is 6 or not. It still says Unexpected token ';'. I've marked the line Opera says the error is in.
Is there some basic feature or limitation of Javascript I'm not aware of? I even tried using parseInt on the value of the variable to ensure it was of the correct data type and still nothing. Should I make the snippets of code inside the if else into functions and simply run the functions inside the if else?
I feel like an idiot. Please help. Both an answer why the code is doing this and the correct solution would be extremely appreciated. Picture attached. The code
PS. Yes, I'm using classes to differentiate single H1's. Sue me.