How to Show or hide a div by using jQuery?
Show or hide a div by using jQuery
<!-- html code as example--> <div class="login-form">...,</div> <div class="signup-form">...,</div> <div class="create-account-bar"><span class="msg1">Don't have account?</span><span class="msg2">Already have an account?</span> <span class="signup" >Sign Up</span><span class="signin" >Sign In</span></div>
<!--jQuery code--> <script type="text/javascript"> jQuery(document).ready(function($){ $(".signup").click(function(){ $(".login-form").hide(); $(".msg1").hide(); $(".msg2").show(); $(".signup-form").show(); $(".signin").show(); $(this).hide(); }); $(".signin").click(function(){ $(".login-form").show(); $(".signup-form").hide(); $(".signup").show(); $(".msg1").show(); $(".msg2").hide(); $(this).hide(); }); });
POST COMMENTS