テキストボックスでプレースホルダーを使用する方法を知りたいです。「ここにあなたの名前を入力してください」と言うテキストボックスを使用したい..そして、ユーザーがテキストボックスをクリックしたときにテキストをクリアしたい。彼がテキストボックスに何も入力しない場合は、「ここに名前を入力してください」と表示されます。
1 に答える
1
以下のhtmlを使用する必要があります
<input type="text" placeholder="Receiver name" maxlength="40" id="fname" name="fname" class="ci-heading ci-shadow-inset ui-input-text ui-body-c ui-corner-all ui-shadow-inset">
Asp.netでは、次のように記述できます。
<ASP:TextBox id="txt1" placeholder="Receiver name"></ASP:TextBox>
単純なhtmlコード:
<html>
<body>
<form action="#" method="POST">
<input type="text" placeholder="Receiver name" maxlength="40" id="fname" name="fname" class="ci-heading ci-shadow-inset ui-input-text ui-body-c ui-corner-all ui-shadow-inset">
</form>
</div>
</body>
</html>
于 2013-02-22T10:39:50.423 に答える