Home > Web Front-end > JS Tutorial > body text

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

WBOY
Release: 2016-05-16 17:40:22
Original
1126 people have browsed it
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




Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!