wenzhixin / bootstrap-show-password

Show/hide password plugin for twitter bootstrap.

Home Page:http://bootstrap-show-password.wenzhixin.net.cn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve to set maxlength

juninhograo opened this issue · comments

Hi man,

I would like to recommend to change this part of the code:
this.$text = $('')
placementFuc
.attr('class', this.$element.attr('class'))
.attr('style', this.$element.attr('style'))
.attr('placeholder', this.$element.attr('placeholder'))
.css('display', this.$element.css('display'))
.val(this.$element.val()).hide();

for this

this.$text = $('')
placementFuc
.attr('class', this.$element.attr('class'))
.attr('maxlength', this.$element.attr('maxlength'))
.attr('style', this.$element.attr('style'))
.attr('placeholder', this.$element.attr('placeholder'))
.css('display', this.$element.css('display'))
.val(this.$element.val()).hide();

Then you can improve your project to set maxlength. In this point we can use anymore html properties.

Best

Fixed in #40