| 1 |
const $ = jQuery; |
| 2 |
|
| 3 |
$( function() { |
| 4 |
$( '.form-field input[type="password"]' ).wrap( '<span class="lp-password-input"></span>' ); |
| 5 |
$( '.lp-password-input' ).append( '<span class="lp-show-password-input"></span>' ); |
| 6 |
|
| 7 |
$( '.lp-show-password-input' ).on( 'click', function() { |
| 8 |
$( this ).toggleClass( 'display-password' ); |
| 9 |
if ( $( this ).hasClass( 'display-password' ) ) { |
| 10 |
$( this ).siblings( [ 'input[type="password"]' ] ).prop( 'type', 'text' ); |
| 11 |
} else { |
| 12 |
$( this ).siblings( 'input[type="text"]' ).prop( 'type', 'password' ); |
| 13 |
} |
| 14 |
} ); |
| 15 |
} ); |
| 16 |
|
| 17 |
|