Home  >  Article  >  Web Front-end  >  Two methods to make the text box input content prompt disappear_javascript skills

Two methods to make the text box input content prompt disappear_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:40:221126browse
The first method:
Based on the new feature of HTML5 input tag - placeholder. In addition, the x-webkit-speech attribute can implement the voice input function.
Copy code The code is as follows:




Second method :
Use span to simulate, position span, and use JS keyboard events determine input and determine whether the content in the span is displayed or hidden.
Copy code The code is as follows:

.org/1999/xhtml">


Untitled Document





< ;form class="border_radius" id="focus">

The focus prompt disappears






The input prompt disappears< ;/h2>

< label>password




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn