Set default value of a password input so it can be read

前端 未结 5 1985
小鲜肉
小鲜肉 2020-12-11 16:42

I want to have a password field which says \"Password\" in it before a user enters their password (so they know what the field is)

I\'d rather just use Javascript, i

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-11 17:35

    Change your password input to be a simple input type text. Then, with JavaScript (or JQuery) on focus event, change it to be a input type password.

    Here is a little untested sample with plain JavaScript (no JQUERY):

    
    
       
    
    
       

提交回复
热议问题