queation variable and view
This commit is contained in:
parent
5e820e89a3
commit
e76d0fdcd1
|
@ -5,7 +5,7 @@ function pickRandomAnswer(){
|
||||||
|
|
||||||
randomAnswer = randomAnswersArrary[Math.floor(Math.random() * randomAnswersArrary.length)]
|
randomAnswer = randomAnswersArrary[Math.floor(Math.random() * randomAnswersArrary.length)]
|
||||||
htmlAnswer = /*HTML*/ `
|
htmlAnswer = /*HTML*/ `
|
||||||
<div>Question: </div><br>
|
<div>Question: ${question}</div><br>
|
||||||
<div>Answer: ${randomAnswer}</div>
|
<div>Answer: ${randomAnswer}</div>
|
||||||
`;
|
`;
|
||||||
clearScreen();
|
clearScreen();
|
||||||
|
|
|
@ -19,7 +19,7 @@ const negativeAnswers = [
|
||||||
];
|
];
|
||||||
var html = /*HTML*/`
|
var html = /*HTML*/`
|
||||||
<div id="ball">8-ball</div>
|
<div id="ball">8-ball</div>
|
||||||
Ask Your question: <input type="text" /><br>
|
Ask Your question: <input type="text" onchange="question = this.value" /><br>
|
||||||
<button onclick="pickRandomAnswer()">Submit</button>
|
<button onclick="pickRandomAnswer()">Submit</button>
|
||||||
`;
|
`;
|
||||||
var htmlAnswer = '';
|
var htmlAnswer = '';
|
||||||
|
@ -27,3 +27,4 @@ var htmlAnswer = '';
|
||||||
var answerArray = [];
|
var answerArray = [];
|
||||||
var randomAnswersArrary = [];
|
var randomAnswersArrary = [];
|
||||||
var randomAnswer;
|
var randomAnswer;
|
||||||
|
var question;
|
Loading…
Reference in a new issue