0
0
mirror of https://github.com/Doodle3D/doodle3d-connect.git synced 2024-11-16 19:17:56 +01:00
doodle3d-connect/js/libs/jquery.psswrd.js

20 lines
474 B
JavaScript
Raw Normal View History

2014-05-08 23:41:02 +02:00
(function($){
$.fn.extend({
psswrd: function() {
return $(this).each(function(){
console.log(" each: ",$(this));
var $input = $(this);
var $checkbox = $($input.data('typetoggle'));
$checkbox.change(function() {
updateType();
$input.focus();
});
2014-05-08 23:41:02 +02:00
updateType();
function updateType() {
$input[0].type = $checkbox.is(':checked') ? 'text' : 'password';
}
});
}
});
})(jQuery);