Skip to content

Commit

Permalink
Create index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
F-alling authored Nov 7, 2024
1 parent 6045cd4 commit f328cc2
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions questfromfelt/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Yes/No Bot</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin-top: 50px;
}
input {
padding: 10px;
width: 300px;
margin-right: 10px;
}
button {
padding: 10px;
}
#response {
margin-top: 20px;
font-size: 24px;
font-weight: bold;
}
</style>
</head>
<body>

<h1>Yes/No Bot</h1>
<input type="text" id="question" placeholder="Ask your question here...">
<button onclick="getResponse()">Ask</button>

<div id="response"></div>

<script>
function getResponse() {
const question = document.getElementById('question').value;
if (question.trim() === '') {
document.getElementById('response').innerText = "Please ask a question!";
return;
}
const answer = Math.random() < 0.5 ? 'Yes' : 'No';
document.getElementById('response').innerText = answer;
}
</script>

</body>
</html>

0 comments on commit f328cc2

Please sign in to comment.