Toggle true and false : toggle « jQuery « JavaScript DHTML






Toggle true and false

    

<html>
  <head>
    <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
                var c = 0;
                $("p").click(function () {
                    $("p").toggle( c++ % 2 == 0 );
                });
        });
    </script>
  </head>
  <body>
    <body>
        <p>Hello</p>
    </body>
</html>

   
    
    
    
  








Related examples in the same category

1.Click to toggle style
2.Slow toggle
3.Normal toggle
4.Toggle fast
5.Toggle in milliseconds
6.Toggle among two or more function calls every other click
7.Use toggle function to change class
8.Click to toggle opacity
9.toggle(fn, fn1): when clicking matched element, the first specified function is fired, clicked again, the second is fired.