How can I expand and collapse a section of the custom script?

I am creating a custom page and I need to be able to expand and collapse a container.
As the following point of sale example.
Selecci%C3%B3n_053