I want to set the var to a specific number, 7
I want a form "guess a number between 1 and 10
with an input box for the user to put their number in.
I need a timeout that so the user can hit a button within 5 seconds to continue the game.
You have the algorithm right there basically, all you need to do is package it.
Just write a function to get the value of the text field, then compare it to the current variable - if they are the same, continue - if not give an alert message or something.
I guess onChange in the text field yu want to set a variable which indicates the person has started typing - since you don't want them to be penalised for being slow to find the right number (or do you?).
Then set the timeout to check this variable after 5 seconds and alert them if they have not complied. -BB "Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.