We can toggle an element using the toggle action.
This HD e-mail page provides a demonstration of toggling when we press the toggle button.
The text becomes hidden over an interval of one second when we press the button again.
The text reappears.
Let's take a look at how this script works.
Here we have a toggle button.
We also have one paragraph element with some text
our script has a click event on the button that toggles the paragraph over an interval of 1000 milliseconds
or one second.
Here you can see we've referenced the button element here's our click event
here we've referenced that we want this event applied to the paragraph tags.
In this case there is one element with paragraph tags and the action is the toggle action the one thousand
refers to the amount of time it will take for the paragraph element to toggle once the button is pressed.