Начало
Игры
Гадалка
Только спросите вопрос, и гадалка JavaScript ответит.
Your question:
Your fortune teller says:
JavaScript Games: Гадалка
<!-- TWO STEPS TO INSTALL FORTUNE TELLER: 1. Copy the coding into the HEAD of your HTML document 2. Add the last code into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- Begin var answers = new Array( "Without a doubt", "Yes!", "Probably so", "It isn't likely", "it's possible", "Absolutely", "Not a chance", "Ask again", "No", "I doubt it", "No Way" ); function fortune() { num = Math.round( (answers.length - 1) * Math.random()); return answers[num]; } // End --> </script> </HEAD> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <BODY> <center> <form> Your question: <input type=text name=question size=40> <input type=button name=ask value="Ask" onClick="if (this.form.question.value!='') this.form.answer.value = fortune();"><br> Your fortune teller says: <input type=text name=answer size=40> </form> </center> <!-- Script Size: 1.27 KB -->