In this example, when the button with the ID "hide" is clicked, the hide() method is triggered, causing the <p> element to be hidden from view.
2-show() Method:
The show() method is used to display the hidden elements. It sets the CSS display property of the element to its default value (e.g., block or inline), making it visible. Here's an example of how to use the show() method:
In this example, when the button with the ID "show" is clicked, the show() method is triggered, causing the previously hidden <p> element to become visible.
Both the hide() and show() methods can be used with various types of elements, such as <div>, <span>, and others. They are commonly used in web development to create dynamic and interactive user interfaces.
About Author
Brijesh Kumar
Database Developer
I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL
Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall
and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com