Creating FAQ Page #5

Merged
izatwin merged 1 commits from arceus-patch-1 into main 2024-05-12 10:11:26 -04:00
Showing only changes of commit cda716c3f7 - Show all commits
+46
View File
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FAQ Page</title>
<style>
/* Add your CSS styles here */
.question {
font-weight: bold;
cursor: pointer;
}
.answer {
display: none;
margin-left: 20px;
}
</style>
</head>
<body>
<h1>Frequently Asked Questions</h1>
<div class="faq-item">
<div class="question">Question 1: What is Lorem Ipsum?</div>
<div class="answer">Answer: Lorem Ipsum is simply dummy text of the printing and typesetting industry.</div>
</div>
<div class="faq-item">
<div class="question">Question 2: Why do we use it?</div>
<div class="answer">Answer: It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.</div>
</div>
<!-- Add more FAQ items as needed -->
<script>
// JavaScript to toggle the visibility of answers
const questions = document.querySelectorAll('.question');
questions.forEach(question => {
question.addEventListener('click', () => {
const answer = question.nextElementSibling;
answer.style.display = (answer.style.display === 'block') ? 'none' : 'block';
});
});
</script>
</body>
</html>