同じ入力の情報でフォームを作成しようとしています。すべての入力で問題なく機能しますが、パスワードでは、ユーザーがパスワードを入力したときにポイントに変更できるとよいでしょう。ユーザーがパスワードを入力した場合にのみ、テキストを入力し、パスワードを入力するように変更します。問題はコードの最後の行にあります。
私はここに人生を持っています:http://jsfiddle.net/Nt9gx/
<form>
<input type="text" name="name" value="name"
onfocus="if (this.value=='name') this.value = '';"
onblur="if (this.value=='') this.value = 'name';"
/>
<input type="text" name="password" value="password"
onfocus="if (this.value=='password') this.value = '' type = password;"
onblur="if (this.value=='') this.value = 'password';"
"if (this.value!=''|| 'password') type = password ;"
/>
</form>