php - Input type password text on IE 8 -


this question has answer here:

i'm working on website

the problem have on input of password: enter image description here

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

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -