I have a <div>, divided into 3 <div>s. Two of those divs are taken as previous and next buttons, having ids prev and next respectively. 3 <div>s having ids diva, divb, and divc are arranged on the bottom. divb and divc have 0 width so that they are hidden and only diva is visible. I want to hide diva to hide (set width to 0) and divb to appear when user click id=next and if the button is clicked again, I want divb to hide and divc to appear. Also I want this to happen reverse if id=prev is clicked.
Below is an image of what I am trying to say;

Here is the fiddle.
I used class to implement what you need. Check DEMO here
Full code: