Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

toggle password hide show

togglePassword.addEventListener('click', function (e) {
    // toggle the type attribute
    const type = password.getAttribute('type') === 'password' ? 'text' : 'password';
    password.setAttribute('type', type);
    // toggle the eye / eye slash icon
    this.classList.toggle('bi-eye');
});
Code language: JavaScript (javascript)
Comment

PREVIOUS NEXT
Code Example
Javascript :: remove script in react js 
Javascript :: normalize js 
Javascript :: pylint vscode disable max line length 
Javascript :: js count word 
Javascript :: how to get the text of a clicked elemet by javascript 
Javascript :: export module in es6 
Javascript :: data fetch with axios 
Javascript :: javascript Program with a Promise 
Javascript :: sort array without changing the original js 
Javascript :: node global directory windows 
Javascript :: add quotes to array items 
Javascript :: js foreach key value 
Javascript :: javascript last element array 
Javascript :: javascript list class properties 
Javascript :: jsp date 
Javascript :: wavesurf js 
Javascript :: new Map() collection in react state 
Javascript :: angular decorators list 
Javascript :: javascript alert variable 
Javascript :: trim string in javascript 
Javascript :: carbon to moment js conversion 
Javascript :: javascript constant variable 
Javascript :: js object.entries with sort 
Javascript :: includes() js 
Javascript :: add class to element vue 
Javascript :: react recoil 
Javascript :: includes in js 
Javascript :: javascript abstract class 
Javascript :: export excel form angular array to excel 
Javascript :: javascript split 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =