Dynamic addition and deletion of elements in an array

Source: Internet
Author: User

1                     <Divclass= "Ser-pup-line1">2                         <Divclass= "Ser-pup-left">3                             <span>Using Accessories</span>4                         </Div>5                         <Divclass= "Ser-pup-right1">6                             <Divclass= "Clone">7                                 <Divclass= "Ser-pup-add">8                                     <Selectname="">9                                         <optionvalue="">Please select</option>Ten                                         <optionvalue="">Large Maintenance</option> One                                         <optionvalue="">Small Maintenance</option> A                                     </Select> -                                     <span></span> -                                     <Selectname=""> the                                         <optionvalue="">Please select</option> -                                         <optionvalue="">Large Maintenance</option> -                                         <optionvalue="">Small Maintenance</option> -                                     </Select> +                                 </Div> -                             </Div> +                             <Divclass= "Ser-add"> A                                 <Divclass= "Ser-lop"> at                                     <imgsrc=".. /img/add.png "alt=""class= "Img-add" /> -                                     <span>Add Use Accessories</span> -                                 </Div> -                                 <Divclass= "Ser-lop"> -                                     <imgsrc=".. /img/minu.png "alt=""class= "Img-minu" /> -                                     <span>Delete</span> in                                 </Div> -                             </Div> to                         </Div> +                     </Div>
. ser-pup-line{width:100%;    height:30px; margin-bottom:20px;}.    ser-pup-left{Float:left;    width:18%;    height:30px;    line-height:30px;    /*background: #007DDB; */}.ser-pup-left span{float:right; margin-right:20px;}.    ser-pup-right{Float:left;    height:30px;    width:82%;    /*background: #009E94; */}.ser-pup-right input{width:85%; height:28px;}.    ser-pup-line1{width:100%;    Overflow:hidden; margin-bottom:20px;}.    ser-pup-left1{Float:left;    width:18%;    height:30px; line-height:30px;}.    ser-pup-right1{Float:left;    Overflow:hidden;    width:82%;    margin-bottom:10px;    /*background: #009E94; */}.ser-lop{float:left; margin-right:10px;}.    ser-pup-add{width:100%;    Overflow:hidden; margin-bottom:10px;}.    Ser-pup-add select{Float:left;    Display:inline-block;    width:37%; height:30px;}.    Ser-pup-add div{Float:left;    Display:inline-block;    width:37%;    height:30px; Line-height: 30px;    Text-align:center; border:1px solid #ccc;}.    Ser-pup-add span{Float:left;    Display:inline-block;    width:25px;    height:15px;    border-bottom:2px solid #ccc;    Color: #ccc; margin:0 3%;}.    ser-add{Float:left;    width:100%;    height:30px; line-height:30px;}.    Ser-add img{Float:left;    width:28px;    height:28px; Cursor:pointer;}.    Ser-add span{Float:left;    Display:inline-block;    font-size:12px; margin-left:10px;}
Image Click to Clone $ ('. Img-add '). Click (function () {var ATR = $ (". Clone>div"). EQ (0). Clone (); $ (". Clone"). Append (ATR);}) Click on the picture to reduce the $ ('. Img-minu '). Click (function () {Debuggervar arr = $ (". Clone"); for (var j = 0; J <= Arr.length; j + +) {var arr = $ (arr[j]). Find ("div"), for (var i = 0; I <= arr.length; i++) {if (i = = (arr.length-1)) {if (I >= 1) {$ (arr[i]). Remove ( );} return;}}})

  

Dynamic addition and deletion of elements in an array

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.