I am trying to make where if the user clicks on the checkbox, it shows the password in the inputbox as text. And if he/she unchecks, it sets the attribute to password. Any pointers?
Code:
 <!DOCTYPE html>
<html>
<head>
    <script type='text/javascript' src='jquery-3.1.1.min.js'></script>
    <script type='text/javascript' src='jquery-ui/jquery-ui.js'></script>
    <script type='text/javascript'>
        $(document).ready(function(){
            $('#check').click(function(){
                if($('test-input').attr('type', 'text'));
            });
        });
    </script>
</head>
<body>
    <input type='password' id='test-input' /> Show password <input type='checkbox' id='check' />
</body>
</html>
 
     
     
     
     
     
    