Show and hide div on one button Click using jquery - Free Asp.Net,MVC,AngularJs,Jquery,Javascript,Sql Server,WCF,Entity framework snippets and tutorial

Show and hide div on one button Click using jquery

In this article I am going to explain how to show and hide div on one button Click using jquery

Show and hide div on one button Click using jquery




Implementation:
You can show and hide div on button click using jquery Toggle function. I have created an example.

HTML markup:
<html>
<head>
  <title>toggle demo</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
</head>
<body> 
<input type="submit" value="Show and Hide" id="button">
<div id="test">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>

<script>
    $("#button").click(function () {
        $("#test").toggle();
    });
</script>
</body>
</html>


What do you think about this article?

If you found this article useful, please share and follow on Facebook, Twitter, Google Plus and other social media websites. To get free updates subscribe to newsletter. Please put your thoughts and feedback in comments section.

Share this

Share on FacebookTweet on TwitterPlus on Google+


EmoticonEmoticon