In this tutorial i will show you onclick show hide div jquery demo. I will use jQuery to show or hide a specific div. You can use hide and show div using javascript with example but i will use jQuery.
With jQuery, you can hide and show html dom with the hide()
and show()
methods:
Syntax:
The optional speed parameter specifies the speed of the hiding/showing, and can take the following values: "slow", "fast", or milliseconds.
$("#hide").click(function(){
$("p").hide();
});
$("#show").click(function(){
$("p").show();
});
The following example demonstrates the speed parameter with hide()
:
$("button").click(function(){
$("p").hide(1000);
});
Hope it can help you.
#jquery #example