# learnpress/4.4.0/assets/src/js/utils/show-password.js

LearnPress – WordPress LMS Plugin for Create and Sell Online Courses, version 4.4.0. 17 lines.

- Page: https://pluginprobe.com/plugins/learnpress/4.4.0/code/assets/src/js/utils/show-password.js
- Raw: https://pluginprobe.com/plugins/learnpress/4.4.0/raw/assets/src/js/utils/show-password.js
- Modified: 2024-08-10T07:01:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/learnpress/4.4.0/code/assets/src/js/utils/show-password.js#L10-L20`.

```javascript
const $ = jQuery;

$( function() {
	$( '.form-field input[type="password"]' ).wrap( '<span class="lp-password-input"></span>' );
	$( '.lp-password-input' ).append( '<span class="lp-show-password-input"></span>' );

	$( '.lp-show-password-input' ).on( 'click', function() {
		$( this ).toggleClass( 'display-password' );
		if ( $( this ).hasClass( 'display-password' ) ) {
			$( this ).siblings( [ 'input[type="password"]' ] ).prop( 'type', 'text' );
		} else {
			$( this ).siblings( 'input[type="text"]' ).prop( 'type', 'password' );
		}
	} );
} );


```
