jQuery Masked Input Example
jQuery Mask Unmask Password Asterisk
This jquery mask unmask password tool is very useful when you need to implement mask unmask input text jquery html functionality and then how to get value of text input with edit mask mode. Find the jQuery code snippet below :-
mask unmask input text jquery plugin |
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jquery mask unmask password</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var inputTarget = document.querySelector('#inputPhone');
$('input[type="checkbox"]').click(function () {
if ($(this).prop("checked") == true) {
inputTarget.type = 'password';
}
else if ($(this).prop("checked") == false) {
inputTarget.type = 'text';
}
});
});
function GetValueTextbox() {
alert($("#inputPhone").val());
}
</script>
</head>
<body>
<div>
<h1>Mask Unmask Input Text jQuery Value</h1>
<input type="password" value="admin" id="inputPhone"/>
<input type="checkbox" checked="checked" id="chkMask"/> Mask/UnMask
<br/><br/>
<input type="button" id="btnShow" value="Get Value" onclick="GetValueTextbox();"/>
</div>
</body>
</html>
jQuery Masked Input Example
Reviewed by Ravi Kumar
on
8:40 PM
Rating:
No comments: