php - Input type password text on IE 8 -
this question has answer here:
- changing <input> type in ie javascript 3 answers
i'm working on website
the problem have on input of password:
when click on on ie9 , other browsers chrome , mozilla, text changes can enter password.
but doesn't happen on ie8, if click on text stays there always, can't enter pass.
this input code:
<input class="login_modal password" type="text" value="contraseña" onfocus="this.type='password';this.value=''" onblur="if(this.value == ''){this.type='text';this.value='contraseña';}" />
any ideas make work cross-browser , ie8 also?
you can use jquery :
var defaultval = 'contraseña'; $('.password').on('focus', function(){ var $this = $(this); var valofthisbox = $this.val(); if(valofthisbox === '' ){ this.val(defaultval); }else{ this.attr('type','password').val(''); } });
Comments
Post a Comment