JS clears the text box content and triggers the js method when the restore and mouse leaves the text box. The text box js
The text box to be filled in for multiple websites provides a default prompt language by default. When you click this text box, you can clear the default text, when the input text is deleted and the focus leaves the text box, the default text is written into the text box.
The Code is as follows:
<! DOCTYPE html>
The above Code meets our requirements. When you click the text box, you can clear the content in the text box. If no content is entered in the text box, when the mouse focus leaves the text box, the value of the text box is restored to the default state. However, if the password box is not displayed in plain text, you can refer to the prompt section in the JavaScript implementation input box (Password box.
How to trigger js when the mouse leaves the text box
<% @ Page Language = "C #" AutoEventWireup = "true" CodeBehind = "WebForm1.aspx. cs" Inherits = "textBox. WebForm1" %> <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Articles you may be interested in:
- Clear the js Code of the text box content when refreshing
- Js Code that captures the content of the input text box and changes the event
- The textarea height of the Javascript text box scales in and out as the content increases automatically.
- Use js to dynamically add text boxes to the foreground, and obtain text box content in the background (sample code)
- A simple example of JS determining the event of text box content change
- Js: How to synchronously obtain the content of a text box from the div layer on the input text page in the text box
- Javascript auto-Restore text box click to clear the default text