davist11/jQuery-Show-Password — Issue #3: Retain old attributes
Author: dom2503
Created: 2011-12-26 19:42:44+00:00
State: open

First of all: Thanks for the plugin!

When using the new HTML5 form attributes, it would be really nice, if the plugin would retain the old values of the attributes.

Here's a fix, that is probably to specific, because it only keeps the "required" and the "placeholder" attribute, but this at least worked for my use case:

//Create the input to switch
$('', {
'class': o.showPasswordInputClass,
css: {
display: 'none',
left: elPosition.left,
top: elPosition.top
},
type: 'text',
required: $this.attr('required'),
placeholder: $this.attr('placeholder')
}).appendTo($parent);

Just as an idea..