I have created a password field with id pass
, and a checkbox with id check
:
<input type="password" id="pass">
<input type="checkbox" id="check" />Show Password
This jQuery code is used to change the password field into text field when the check box is checked, but this is not functioning correctly. The password remains as a password field even after the checkbox is checked.
$(document).ready(function () {
$('#check').change(function () {
$('#pass').attr('type','text');
});
});