I implemented a see password button for my password input using html and jquery so when I run it in Microsoft Edge and IE the browsers themselves have one button as default to see password for type=password inputs. and the result will be two see password button!
Now I have 3 solution I think!
1. Disable Edge and IE see password default button (How?)
2. Disable my see password Button in Edge and IE (How?)
3. Enable same option for chrome and Firefox (How?)
the third solution is the best i think. does chrome and Firefox have default see password button? If they have how can i use them?
Here is my code:
<input type="password" class="form-control" id="password" placeholder="password " name="password">
<span class="input-group-btn">
<button id="show_password" class="btn btn-secondary" type="button" style="padding:9px;">
<span class="glyphicon glyphicon-eye-open"></span>
</button>
</span>
<script>
$('#show_password').hover(function functionName() {
//Change the attribute to text
$('#password').attr('type', 'text');
$('.glyphicon').removeClass('glyphicon-eye-open').addClass('glyphicon-eye-close');
}, function () {
//Change the attribute back to password
$('#password').attr('type', 'password');
$('.glyphicon').removeClass('glyphicon-eye-close').addClass('glyphicon-eye-open');
}
);
</script>