0
我想知道如何在文本框中使用佔位符。我想使用一些必須說「輸入你的名字在這裏」的文本框。我想清除文本當用戶單擊文本框。如果他沒有在文本框中輸入任何內容,它應該說「在這裏輸入你的名字」。文本框中的佔位符文本在C#中單擊時應隱藏.net
我想知道如何在文本框中使用佔位符。我想使用一些必須說「輸入你的名字在這裏」的文本框。我想清除文本當用戶單擊文本框。如果他沒有在文本框中輸入任何內容,它應該說「在這裏輸入你的名字」。文本框中的佔位符文本在C#中單擊時應隱藏.net
您需要使用下面的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>