[英]How to get rid of text after clicking in the form
我有一個帶有以下代碼的留言簿表單:
<input class='tbox' type='text' value='Type here' name='code_verify' size='15' maxlength='20'>
單擊“在此處輸入”框后如何刪除文本?
我的意思是,當我單擊“在此處鍵入”字段時,“消失在此處”一詞必須消失並且光標閃爍。
任何幫助,將不勝感激。
謝謝
用這樣的js
<input class='tbox' type='text' value='Type here' name='code_verify'
size='15' maxlength='20' onfocus="if (this.value == 'Type here') { this.value=''}">
<input class="tbox" type="text"
onfocus="if (this.value==this.defaultValue) this.value=''"
onblur="if (this.value=='') this.value=this.defaultValue"
value="Type here" name="code_verify" size="15" maxlength="20:>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.