+ 4
I am having problems with this code.
For some reason I keep on getting this error: "Syntax Error: Unexpected end of script." https://code.sololearn.com/WuQ0Dp8XDQn0/?ref=app
8 Answers
+ 3
It's because you declare variable that has the same name "bike" which overwrites your function and that's why it says that the function is not defined.
Function and variable can't have the same name.
+ 5
I closed the bike function, but I am still getting errors.
+ 5
Thanks Toni Isotalo. Now the code returns error in the alert, wether I check bike or not.
+ 5
Thanks Toni Isotalo.
+ 3
You didn't close your bike() function. You're missing one } bracket
+ 3
"test" variable is a string because you store the checkbox value to it so it doesn't have .checked property which makes it false.
+ 3
dude it's working.by the way,nice code
+ 2
you haven't close the bike() function, add another } there