在input中加入 <input tye="text" oniput="if(this.value==''){this.type='text'}else{this.type='password'}"/>