The "JavaScript" component focuses on values between the anchor points in the page

Source: Internet
Author: User

These two small functions are useful in some modern mobile phone pages.

How to trigger an event by placing the cursor on the input box and leaving the input box to trigger another event? Even if the user does not enter anything ...

It is simple to pass values between pages, but how do you pass values between anchor points within a page?


I. BASIC OBJECTIVES


There is a page with an input box above, a hyperlink, and these two things are not associated with anything,

Just because the function is not big, so the two functions together write

1. Input box function

Once the cursor is placed on the dialog, the background turns red, and once the user's mouse clicks elsewhere, the background turns gray again.



2. Super Link function

The bottom anchor at the bottom of the page passes the value of the value text=1 by the Get method, and there is a disabled input box underneath the bottom anchor point, and the text parameter is not kept in the polling address bar

Start if you do not click, there is no text parameter, so the input box is always displayed as null

Once the hyperlink is clicked, the following dialog box changes to 1 after 0.5 seconds, so the user's feeling is processed in real time due to the millisecond processing.


There is a back hyperlink above the disabled, emptying the parameters of the page, and then pulling the scroll bar down again to show null.

Note The URL of the browser when the value is successfully passed between the anchor points in the page:



Second, the production process


Do not introduce any plug-ins, directly open an HTML page to write it, see the following code:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">


The "JavaScript" component focuses on values between the anchor points in the page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.