Instance
JQuery Hide ()
Simple jquery Hide () method demo.
JQuery Hide ()
Another hide () instance. Demonstrates how to hide text.
JQuery Hide () and show ()
With JQuery, you can use the Hide () and show () methods to hide and display HTML elements:
Instance
$ ("#hide"). Click (function () {
$ ("P"). Hide ();
});
$ ("#show"). Click (function () {
$ ("P"). Show ();
});
Grammar:
$ (selector). Hide (speed,callback);
$ (selector). Show (Speed,callback);
Optional speed parameters Specify the hidden/displayed speed, which can take the following values: "Slow", "fast", or milliseconds.
The optional callback parameter is the name of the function that was executed after the hide or display was completed.
The following example shows the Hide () method with the speed parameter:
Instance
$ ("button"). Click (function () {
$ ("P"). Hide (1000);
});
JQuery Toggle ()
With JQuery, you can use the toggle () method to toggle the Hide () and show () methods.
Displays the elements that are hidden and hides the displayed elements:
Instance
$ ("button"). Click (function () {
$ ("P"). Toggle ();
});
Grammar:
$ (selector). Toggle (Speed,callback);
Optional speed parameters Specify the hidden/displayed speed, which can take the following values: "Slow", "fast", or milliseconds.
The optional callback parameter is the name of the function that was executed after the toggle () method was completed.