Select box Move Right-html

Source: Internet
Author: User

<!DOCTYPE HTML><HTML><Head><title>CheckBox Practice</title><Metahttp-equiv= "keywords"content= "Keyword1,keyword2,keyword3"><Metahttp-equiv= "description"content= "This is my page"><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><Scripttype= "Text/javascript">window.onload= function() {        /*about feature implementation 1. How can I move one item on the left to the right?                                    How do I get the selected item in select?                                                                        select.options;----get an array of all the option. Select has a property called Selectindex.                                                                        Gets the index of the selected item.                                                                        var Option=select.options[select.selectindex]----Get the selected item.                                                                         Rightselect.add (option); */        //move one to the right.document.getElementById ("removerightonly"). onclick= function() {            //gets the item selected in the left select.            var Left=document.getElementById (" Left"); //get the Select on the left            varoption=Left.options[left.selectedindex];//get the item selected on the left.document.getElementById (" Right"). Add (option);        }; /*2. How to move the left to the right of all movements.         The options get all, make all of them, use Rightselect.add to add all to the right. */document.getElementById ("Removerightall"). onclick= function() {            //get all the left            var Left=document.getElementById (" Left"); varOps=left.options;//get all the option on the left                        //iterate through each option and add it to the right.             while(Ops.length>0) {document.getElementById (" Right"). Add (ops[0]);    }        }; }</Script></Head><Body>    <TableAlign= ' Center '>        <TR>            <TD><Selectsize= "Ten"ID= "Left">                    <option>Option 1</option>                    <option>Option 2</option>                    <option>Option 3</option>                    <option>Option 4</option>                    <option>Option 5</option>                    <option>Option 6</option>                    <option>Option 7</option>                    <option>Option 8</option>                    <option>Option 9</option>            </Select></TD>            <TD><inputtype= "button"value= "--->"ID= "Removerightonly"><BR>                <inputtype= "button"value= "===>"ID= "Removerightall"><BR>                <inputtype= "button"value= "<---"ID= "Removeleftonly"><BR>                <inputtype= "button"value= "<==="ID= "Removeleftall"><BR>            </TD>            <TD><Selectsize= "Ten"ID= "Right">                    <option>Option 10</option>            </Select></TD>        </TR>    </Table></Body></HTML>

Select box Move Right-html

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.