<!DOCTYPE html PUBLIC "
<html xmlns="
<head>
<meta http
<title>無標題文檔</title>
<script type="text/javascript" src="jquery
<script type="text/javascript">
/**
*動態的給左邊的下拉列表創建選項
*具體情況可以從數據庫讀取數據動態創建選項
*/
$(document)
for(var i=
{
$("#fb_list")
}
})
$(function(){
$("#add")
if($("#fb_list option:selected")
{
$("#fb_list option:selected")
$("#select_list")
$(this)
})
}
else
{
alert("請選擇要添加的分包!");
}
})
})
$(function(){
$("#delete")
if($("#select_list option:selected")
{
$("#select_list option:selected")
$("#fb_list")
$(this)
})
}
else
{
alert("請選擇要刪除的分包!");
}
})
})
</script>
</head>
<body>
<table width="
<tr>
<td colspan="
</tr>
<tr>
<td class="black" width="
<select id="fb_list" multiple="multiple" style="text
</td>
<td align="center" width="
<input type="button" id="add" value="添加>>" />
<br/>
<br/>
<input type="button" id="delete" value="<<刪除" />
</td>
<td class="black" width="
<select id="select_list" multiple="multiple" style=" text
</td>
</tr>
</table>
</body>
</html>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20346.html