Skip to content

This code is an HTML page with a Q&A section built using JavaScript and CSS. The HTML page includes questions and their answers which are initially hidden. The JavaScript code controls the display of the answers when the user clicks the plus/minus button, toggling the visibility of the answer text.

Notifications You must be signed in to change notification settings

paribhandarkar/q-a-section

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Q&A section

This code is a basic implementation of an accordion-style Q&A section using HTML, CSS, and JavaScript.

The HTML section contains a section with a class of "questions" that contains multiple articles, each representing a question and answer.

The JavaScript section selects all elements with a class of "question" and attaches a click event listener to their "btn" child element. When clicked, the "question-text" div toggles its visibility by adding or removing a "show-text" class from the "question" div. The "show-text" class is defined in the CSS to have a height of auto and overflow: visible, making the answer visible when added. The JavaScript code controls the display of the answers when the user clicks the plus/minus button, toggling the visibility of the answer text.

Demo

You can try out the application by visiting this link.

Technologies Used

  • HTML
  • CSS
  • JavaScript

Getting Started

To get started with this project, clone the repository and open the index.html file in your preferred web browser.

image

About

This code is an HTML page with a Q&A section built using JavaScript and CSS. The HTML page includes questions and their answers which are initially hidden. The JavaScript code controls the display of the answers when the user clicks the plus/minus button, toggling the visibility of the answer text.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published