Some ideas and plug-ins about jquery's dynamic addition and deletion of controls _ jquery

Source: Internet
Author: User
This code is compressed to 100 rows, which is easy to expand and increase the number of controls. When I was working on a project last year, I met a module and needed to dynamically increase or decrease controls. The first solution was to use UpdatePanel for partial page updates. Because the page is large and there are many controls, it will become very slow when many controls are dynamically added. Later, I thought about using javascript for dynamic increase and decrease controls. Finally, When I submitted the page, I collected the data of the page controls. The effect was great. However, since it was only for that module, the scalability was poor, at that time, it was very complicated to write javascript code. To increase or decrease the result dynamically, more than 500 lines of javascript code were written.

Later, the code was rewritten when I was idle at the end of last year. Now the code is compressed into 100 rows, which is easy to expand and increase the number of controls and is easy to use.

:

A simple example:

The Code is as follows:






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.