Skip to content

Instantly share code, notes, and snippets.

Created January 6, 2016 19:23
Show Gist options
  • Select an option

  • Save anonymous/a0f88dd3c6346f46e90c to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/a0f88dd3c6346f46e90c to your computer and use it in GitHub Desktop.
JS Fortune Teller // source https://jsbin.com/suloqo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Fortune Teller</title>
</head>
<body>
<h1>JS Fortune Teller</h1>
<img height="300px" src="http://media2.popsugar-assets.com/files/2013/09/09/819/n/1922441/d3913d5c8219d812_851b6e0c077111e3a74122000aeb10b1_7.xxxlarge/i/Fortune-Teller.jpg">
<br>
<input type="text" placeholder="Your Question?">
<br>
<label> Who is this question about? </label>
<input id="name" type="text" placeholder="name">
<br>
<input type="submit" value="Ask?" onclick="askQuestion()">
<script id="jsbin-javascript">
var intros = ["The ball is telling me that ", "The spirits say ", "Neptune crossing Venus means"];
var students = [""];
var middles = [" in the case of ", "for the mysterious ", " anyone of knowlege will know that "];
var answers = [ "the answer is no.", " the awnser to that question is yes", "the start don't give a clear answer" ];
function askQuestion() {
var name = Document.getElementById("question");
var question = Document.getElementById("name");
console.log( name, question);
var answer = "I don't know ask later";
//we will be adding our code here
// condition if you did not ask a question
//condition if you did ask a question without a name
// condition if you added a name without a question
}
// conditional syntax
// if (condition) {
// block of code to be executed if the condition is true
// }
</script>
<script id="jsbin-source-javascript" type="text/javascript">var intros = ["The ball is telling me that ", "The spirits say ", "Neptune crossing Venus means"];
var students = [""];
var middles = [" in the case of ", "for the mysterious ", " anyone of knowlege will know that "];
var answers = [ "the answer is no.", " the awnser to that question is yes", "the start don't give a clear answer" ];
function askQuestion() {
var name = Document.getElementById("question");
var question = Document.getElementById("name");
console.log( name, question);
var answer = "I don't know ask later";
//we will be adding our code here
// condition if you did not ask a question
//condition if you did ask a question without a name
// condition if you added a name without a question
}
// conditional syntax
// if (condition) {
// block of code to be executed if the condition is true
// }
</script></body>
</html>
var intros = ["The ball is telling me that ", "The spirits say ", "Neptune crossing Venus means"];
var students = [""];
var middles = [" in the case of ", "for the mysterious ", " anyone of knowlege will know that "];
var answers = [ "the answer is no.", " the awnser to that question is yes", "the start don't give a clear answer" ];
function askQuestion() {
var name = Document.getElementById("question");
var question = Document.getElementById("name");
console.log( name, question);
var answer = "I don't know ask later";
//we will be adding our code here
// condition if you did not ask a question
//condition if you did ask a question without a name
// condition if you added a name without a question
}
// conditional syntax
// if (condition) {
// block of code to be executed if the condition is true
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment