Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Javascript show password...

<!DOCTYPE html>
<html>
    <head>
        <title>JavaScript: Show And Hide Input Password Text</title>
        <meta charset="windows-1252">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        
        <style>
            #pass{padding: 10px;}
        </style>
        
        <script>

            function showPass()
            {
                var pass = document.getElementById('pass');
                if(document.getElementById('check').checked)
                {
                    pass.setAttribute('type','text');
                }else{
                    pass.setAttribute('type','password');
                }
            }

        </script>
        
        
    </head>
    <body>
        <input type="password" id="pass"/>
        <input type="checkbox" id="check" onclick="showPass();"/>Show Password
    </body>
</html>
Comment

show password using javascript

<script>
$(document).ready(function(){
    $('#checkbox').on('change', function(){
        $('#password').attr('type',$('#checkbox').prop('checked')==true?"text":"password"); 
    });
});
</script>
<input type="password" id="password"> 
<input type="checkbox" id="checkbox">Show Password
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript foreach arrow function 
Javascript :: javascript check for duplicates in array 
Javascript :: js history 
Javascript :: moment to date object 
Javascript :: clear input field data in jquery 
Javascript :: difference between package.json and package lock.json 
Javascript :: javascript check date is greater than today 
Javascript :: local reload go to top 
Javascript :: check if s3 bucket exists in lambda 
Javascript :: feet to mile js 
Javascript :: SyntaxError: await is only valid in async function 
Javascript :: postgres boolean column 
Javascript :: get year from date in mongodb 
Javascript :: create-react-app npm yarn 
Javascript :: jquery templates 
Javascript :: react fragment inside map with key prop 
Javascript :: change color react icon 
Javascript :: how to get input with name in jest test 
Javascript :: javascript convert utc to local time 
Javascript :: urlsearchparams to object 
Javascript :: mongoose connection increase timeout in node js 
Javascript :: javascript typeof 
Javascript :: javascript round 
Javascript :: how to print a array js 
Javascript :: js innerhtml 
Javascript :: extended class call method from super in javascript 
Javascript :: how to get java model attributes from javascript 
Javascript :: javascript slice string from character 
Javascript :: js copy text 
Javascript :: get bytes from string javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =