Javascript Tutorial in Hindi – 53 Javascript Accordion , How to create accordion in Javascript




#accordionJavascript,
#javascriptAccordion,
#createJavascriptAccordion,
#buildJavascriptAccordion

Accordion its an instrument that expands and compresses.In javascript, we have to generate the same concept using h2 and paragraph tags.

In this example, we have used the querySelectorAll() method with style, nextElementSiblings property to show and hide paragraph.

initially hide all paragraphs on page load event. then click on h2 tag and show paragraph by if it is in hidden format or hide paragraph if it is in show format.

Original source


5 responses to “Javascript Tutorial in Hindi – 53 Javascript Accordion , How to create accordion in Javascript”

Leave a Reply