SoFunction
Updated on 2025-02-28

Specific implementation method for multiple selection, removal and exchange of content in js Select drop-down list box


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:///TR/xhtml1/DTD/">
<span class='wp_keywordlink_affiliate'><a href="tag/html" title="View all articles in html" target="_blank">html</a></span>4/">
<<span class='wp_keywordlink_affiliate'><a href="tag/html" title="View all articles in html" target="_blank">html</a></span>>
<head>
<title>Select drop-down list box for multiple selection, removal, and exchange content</title>
<meta http-equiv="Content-Type" content="text/<span class='wp_keywordlink_affiliate'><a href="tag/html" title="View all articles in html" target="_blank">html</a></span>; charset=gb2312">
</head>
<body style="font-size:12px">
<form name="form1" method="post" action="">
<table width="380" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="150"><table width="150" border="0" cellpadding="1" cellspacing="1" bgcolor="#CAFAFC">
      <tr>
<td height="25" background="wp-content/uploads/2012/05/" bgcolor="#FFFFFF">Please select:</td>
      </tr>
      <tr>
        <td align="center" bgcolor="#FFFFFF"><select name="sel_place1" size="6" multiple style="width:100px " >
<option value="sel1">Jiangsu Province</option>
<option value="sel2">Guangdong Province</option>
<option value="sel3">Henan Province</option>
<option value="sel4">Jilin Province</option>
<option value="sel5">Zhejiang Province</option>
        </select></td>
      </tr>
    </table></td>
    <td width="80" align="center" valign="bottom"><input name="sure1" type="button"
  onClick="allsel(document.form1.sel_place2,document.form1.sel_place1);" value="<<">

  <input name="sure2" type="button"
  onClick="allsel(document.form1.sel_place1,document.form1.sel_place2);" value=">>" align="center" height="2"></td>
    <td width="150"><table width="150" border="0" cellpadding="1" cellspacing="1" bgcolor="#CAFAFC">
      <tr>
<td height="25" background="wp-content/uploads/2012/05/" bgcolor="#FFFFFF">Please select:</td>
      </tr>
      <tr>
        <td align="center" bgcolor="#FFFFFF"><select name="sel_place2" size="6" multiple style="width:100px ">
            </select></td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
<script language="javascript">
function allsel(n1,n2)
{
  while(!=-1)
  {
   var indx=;
   var t=[indx].text;
   (new Option(t));
   (indx);
  }
}
</script>
</body>
</html></td>
   </tr>
 </table>