jQuery function to hide and show HTML elements

We can show and hide HTML elements with the show()and hide  methods in jquery. A simple example is as follows

Example

$("#hide").click(function(){
  $("p").hide();
});

$("#show").click(function(){
  $("p").show();
});

Similarly, you can apply it to any html element such as a button.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

Up ↑

Create your own website, free on WordPress.com.Create your own website.
Start free