Course Content
AJAX and jQuery Plugins
Learn how to use AJAX and plugins with jQuery to create dynamic and interactive web applications.
0/3
JQuery
About Lesson
JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>FAQ Section</title>
  <style>
    .faq {
      margin-bottom: 10px;
    }
    .answer {
      display: none;
      padding: 10px;
      background-color: #f0f0f0;
    }
  </style>
</head>
<body>
  <div class="faq">
    <h3 class="question">What is jQuery?</h3>
    <p class="answer">jQuery is a JavaScript library for simplifying DOM manipulation.</p>
  </div>
  <div class="faq">
    <h3 class="question">Why use jQuery?</h3>
    <p class="answer">It makes JavaScript coding easier and faster.</p>
  </div>
  <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
  <script>
    $(document).ready(function () {
      $(".question").click(function () {
        $(this).next(".answer").slideToggle();
      });
    });
  </script>
</body>
</html>