I wrote a simple JavaScript code that allows people to enter a number and it should return either FizzBuzz, Fizz, Buzz or just the number if it did not meet the conditions of the FizzBuzz game. I then tried to create a button in HTML with the following code:
<button onclick="fBCalc(prompt("Enter a number!"))">FizzBuzz</button>
I have also tried this:
<input type="button" name="FizzBuzz" value="FizzBuzz" onClick="fBCalc(prompt("Enter a number!"))" />
Both methods did not work. I have searched Google for an answer but I have tried them and nothing happens when I click the button. I made sure that the function was called correctly. This works without the button so I do not know why it shouldn't work with a button. Unless a button is unable to prompt o.o. Does anyone know what is wrong?
Here is a pastebin to my full HTML code: http://pastebin.com/YPGdbTVQ