Js drop-down selection box and input box are linked to add the selected value to the input box _ javascript tips

Source: Internet
Author: User
This article mainly introduces how to add the selected value to the input box by linking the js drop-down box and the input box. It involves the onchange event and page element traversal techniques in javascript and has some reference value, for more information about how to add a selected value to the input box, see the examples in this article. Share it with you for your reference. The details are as follows:

This example shows how to associate the js drop-down box with the input box to directly add the selected value to the input box. I believe many of you have seen this effect, saving the trouble of user input. Here, we use JS to directly assign the value to the input box. After understanding the principle, we can flexibly use it to expand more special effects.

Run the following command:

The Online Demo address is as follows:

Http://demo.jb51.net/js/2015/js-select-value-to-input-codes/

The Code is as follows:

The drop-down selection box is linked with the input box to directly add the selected value to the input box.  Select  Unti1  Unti2  Unti3  Unti4  Unti5

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.