JQuery Toggle Function

 When you click on toggle button your data will be hide and show alternatively 

Let's have an example

<html>   

    <head>  

        <title>  

            Jquery Tutorial 

        </title> 

          <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">      </script> 

<style>

.a

{

height:100px;

width:100px;

background-color:red;

}

.b

{

height:100px;

width:100px;

background-color:green;

}

</style>

    </head>    

    <body> 

<button>Click Here</button>

<div class="a">Jquery</div><br>

<div class="b">Jquery</div>

        <!-- jQuery script -->

        <script>  

            $(document).ready(function() { 

                $("button").click(function() { 

                    $(".a").toggle();

                    $(".b").toggle();

                });

            }); 

        </script>  

    </body>   

</html>  

Comments

  1. Nicely Explained the topic "Designing Services" same as you mention about is quite popular these days in the united kingdom, United States, Ireland, And other countries. our company provides same services without any risk, kindly visit to know Website Designing services

    ReplyDelete

Post a Comment

Popular Posts