JS choose to add Delete content menu code

Source: Internet
Author: User
Keywords Web page production Ajax javascript
Tags ajax code content delete document html http javascript

<HTML>


<HEAD>


<TITLE> Web page Special effects |jzread.com/Choose Add Delete Content menu </TITLE>


<meta http-equiv= "Content-type content=" HTML; charset=gb2312 ">


</HEAD>


<BODY>


<p> Select one or more items and then click Add or Remove (hold down SHIFT or CTRL to select more), or double-click on the selection to add and remove. </p>


<form method= "POST" name= "MyForm" >


<table border= "0" width= ">
"

<tr>


<td width= "costs" >


<select style= "width:100%" ListBox name= "List1" size= "ondblclick=" Moveoption (Document.myform.list1, DOCUMENT.MYFORM.LIST2) ">


<option value= "Beijing" > Beijing </option>


<option value= "Shanghai" > Shanghai </option>


<option value= "Shandong" > Shandong </option>


<option value= "Anhui" > Anhui </option>


<option value= "Chongqing" > Chongqing </option>


<option value= "Fujian" > Fujian </option>


<option value= "Gansu" > Gansu </option>


<option value= "Guangdong" > Guangdong </option>


<option value= "Guangxi" > Guangxi </option>


<option value= "Guizhou" > Guizhou </option>


<option value= "Hainan" > Hainan </option>


<option value= "Hebei" > Hebei </option>


<option value= "Heilongjiang" > Heilongjiang </option>


<option value= "Henan" > Henan </option>


<option value= "Hubei" > Hubei </option>


<option value= "Hunan" > Hunan </option>


<option value= "Inner Mongolia" > Inner Mongolia </option>


<option value= "Jiangsu" > Jiangsu </option>


<option value= "Jiangxi" > Jiangxi </option>


<option value= "Jilin" > Jilin </option>


<option value= "Liaoning" > Liaoning </option>


<option value= "Ningxia" > Ningxia </option>


<option value= "Qinghai" > Qinghai </option>


<option value= "Shanxi" > Shanxi </option>


<option value= "Shaanxi" > Shaanxi </option>


<option value= "Sichuan" > Sichuan </option>


<option value= "Tianjin" > Tianjin </option>


<option value= "Tibet" > Tibet </option>


<option value= "Xinjiang" > Xinjiang </option>


<option value= "Yunnan" > Yunnan </option>


<option value= "Zhejiang" > Zhejiang </option>


<option value= "Hong Kong" > Hong Kong </option>


<option value= "Macau" > Macau </option>


<option value= "Taiwan" > Taiwan </option>


<option value= "Other" > Other </option>


</select>


</td>


<td width= "from" align= "center" >


<input type= "button" value= "Add onclick=" Moveoption (Document.myform.list1, Document.myform.list2) ">< Br><br>


<input type= "button" value= "delete" onclick= "Moveoption (Document.myform.list2, Document.myform.list1)" >


</td>


<TD width= "costs" >


<select style= "width:100%" ListBox name= "List2" size= "ondblclick=" Moveoption (Document.myform.list2, DOCUMENT.MYFORM.LIST1) ">


</select>


</td>


</tr>


</table>


value: <input type= "text" name= "City" size= "" value= ""/>


</form>


<script language= "JavaScript" >


<!--


function Moveoption (e1, E2) {


try{


for (Var i=0;i<e1.options.length;i++) {


if (e1.options[i].selected) {


var e = e1.options[i];


E2.options.add (New Option (E.text, E.value));


E1.remove (i);


I=i-1


   }


  }


Document.myform.city.value=getvalue (DOCUMENT.MYFORM.LIST2);


 }


catch (e) {}


}


function GetValue (geto) {


var allvalue = "";


for (Var i=0;i<geto.options.length;i++) {


allvalue +=geto.options[i].value + ",";


 }


return allvalue;


}


//-->


</script>


</BODY>


</HTML>

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.