How to Show Password in jQuery


Show Password in jQuery


 <!DOCTYPE html>

<html>

<head>

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

<script>

$(document).ready(function(){

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

    $(this).hide();

  });

});

</script>

</head>

<body>


 <input type='password' id='test-input' /> 

 Show password <input type='checkbox' id='check' />


<script type='text/javascript'>

        $(document).ready(function(){

            $('#check').click(function(){

             // alert($(this).is(':checked'));

                $(this).is(':checked') ? $('#test-input').attr('type', 'text') : $('#test-input').attr('type', 'password');

            });

        });

    </script>

</body>

</html>  

Comments

Popular posts from this blog

C.R.U.D Oparetion in (PHP Code)

Search Dropdown - jQuery

Single - File Upload Pluggin with Ajax & PHP