I created a container using a <div>
element which is divided into 3 inner divs. The first two inner divs are meant to serve as previous and next buttons, with ids of prev
and next
respectively. At the bottom, there are 3 more inner divs, each with unique ids of diva
, divb
, and divc
. Both divb
and divc
have their widths set to 0 in order to keep them hidden, while only diva
is visible initially. My goal is to hide diva
by setting its width to 0, then display divb
when the user clicks on the element with id of "next". If the same button is clicked again, I intend for divb
to be hidden and for divc
to become visible. This process should also be reversible if the element with id of "prev" is clicked.
For a visual representation of my description, refer to the image below:
This link contains a fiddle showcasing this concept.