unobtrusive “default” text in input WITHOUT jQuery

前端 未结 7 1780
攒了一身酷
攒了一身酷 2021-01-16 22:15

i\'m trying to write unobtrusive default/placeholder text in input (actually, relatively placed label over input, which hides on onFocus

7条回答
  •  滥情空心
    2021-01-16 22:57

    you will need to manually attach the onfocus and onblur events, having got a handle on the input with getElementById.

    here is an example: http://www.aspsnippets.com/Articles/Watermark-TextBox-using-JavaScript.aspx

提交回复
热议问题