Jump to content

Need help :: Urgent!


KevinY

Recommended Posts

If anyone thinks they can help me out, please reply or email me asap and Ill show you my code so far. Thanks
This seems like a straightforward task, please post your full code and we'll point you in the right direction :)
Link to comment
Share on other sites

Give the question and id:What's Your Question: <input name="input" id="input" type="text" />When button is clicked call tellFortune()<input type="button" name="roll" value="Ask" onclick="tellFortune()">Tell fortune should look something like this.

function tellFortune(){x=document.getElementById('input');newQuestion=x.value;if (newQuestion==oldQuestion){x.value="Please change question";}else { execute();oldQuestion=newQuestion; //Swap values ready for checking next question}}

Remember to declare var oldQuestion=""; as a global variable

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...