开发者

textbox on focus and on blur

开发者 https://www.devze.com 2023-01-21 21:18 出处:网络
When the page loads the textbox is showing default开发者_StackOverflow社区 to State and when clicked on textbox it is showing empty like how it is supposed to work in this code. But when i do not ente

When the page loads the textbox is showing default开发者_StackOverflow社区 to State and when clicked on textbox it is showing empty like how it is supposed to work in this code. But when i do not enter anything into that textbox and move to next textbox i want it show State again. How can i do this?

<input type="textbox" id="state" border="0"  value="State" class="form_textbox4" onFocus="if
(this.value==this.defaultValue) this.value=''; ">


onblur="if (this.value=='') this.value=this.defaultValue;"


Like so:

<input type="textbox" id="state" border="0"  value="State" class="form_textbox4" onFocus="if
(this.value==this.defaultValue) this.value=''; " onBlur="if(this.value=='') this.value=this.defaultValue;">
0

精彩评论

暂无评论...
验证码 换一张
取 消