Hide and show in javascript
Onclick show/hide div jquery demo.
Description: Display or hide the matched elements.
Note: The event handling suite also has a method named .toggle(). Which one is fired depends on the set of arguments passed.
With no parameters, the method simply toggles the visibility of elements:
1 |
The matched elements will be revealed or hidden immediately, with no animation, by changing the CSS property.
If the element is initially displayed, it will be hidden; if hidden, it will be shown.
Show/hide div jquery by id
The property is saved and restored as needed. If an element has a value of , then is hidden and shown, it will once again be displayed .
When a duration, a plain object, or a single "complete" function is provided, becomes an animation method.
The method animates the width, height, and opacity of the matched elements simultaneously. When these properties reach 0 after a hiding animation, the style property is set to to ensure that the element no longer affects the layout of the page.
Durations are given in milliseconds; higher values indicate slower animations, not faster ones.
The strings and can be supplied to indi