Delete default value of an input text on click

前端 未结 13 1836
逝去的感伤
逝去的感伤 2020-11-29 18:24

I have an input text :


I want to put a default value like

相关标签:
13条回答
  • 2020-11-29 19:09

    we can do it without using js in the following way using the "placeholder" attribute of html5 ( the default text disappears when the user starts to type in ,but not on just clicking )

    <input type="email" id="email" placeholder="xyz@abc.com">

    see this: http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_input_placeholder

    0 讨论(0)
提交回复
热议问题