HTMLElement.toggleVisibility method
HTMLElement › toggleVisibility
Official
Toggles the visibility of the element using cssvisibility property. Signature:
toggleVisibility(visible: boolean): voidParameters:
| Parameter | Type | Description |
|---|---|---|
| visible | boolean | Whether to show the element. |
Returns: void
Example:
document.body.toggleVisibility(true);document.body.toggleVisibility(false);