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)]
|
||||
htmlAnswer = /*HTML*/ `
|
||||
<div>Question: </div><br>
|
||||
<div>Question: ${question}</div><br>
|
||||
<div>Answer: ${randomAnswer}</div>
|
||||
`;
|
||||
clearScreen();
|
||||
|
|
|
@ -19,7 +19,7 @@ const negativeAnswers = [
|
|||
];
|
||||
var html = /*HTML*/`
|
||||
<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>
|
||||
`;
|
||||
var htmlAnswer = '';
|
||||
|
@ -27,3 +27,4 @@ var htmlAnswer = '';
|
|||
var answerArray = [];
|
||||
var randomAnswersArrary = [];
|
||||
var randomAnswer;
|
||||
var question;
|
Loading…
Reference in a new issue