Script Categories

Games >>> Fortune Teller.

Just ask a yes or no question and the JavaScript fortune teller will reply.

Your question:
Your fortune teller says:

Add the below code to the <body> section of your page:

<script language="javascript" type="text/javascript">
/* Visit for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
var answers = new Array(
"Without a doubt",
"Probably so",
"It isn't likely",
"it's possible",
"Not a chance",
"Ask again",
"I doubt it",
"No Way"
function fortune() {
num = Math.round( (answers.length - 1) * Math.random());
return answers[num];
//  End -->
Your question:  <input type=text name=question size=40>
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>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.

Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).

Special fresh news about Orbex read by this site .