How to write my own toggle function in jquery.
<head> <script type="text/javascript" src="jquery-1.3.2.min.js"></script> <script> $(function(){ $('#dv').bind('click',function(){ $("#toTgl:hidden").show(); }); $('#dv').trigger('click'); }); </script> </head> <body> <div id='dv' onclick="$('#toTgl').hide()"><center>Toggle</center></div> <br/> <div id='toTgl'><center>Change This</center></div> </body>
Both (show & hide) gets triggered and I