左侧数据移到右侧 select 实现法
来源:互联网 发布:黑猩猩智商知乎 编辑:程序博客网 时间:2024/06/03 01:03
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>无标题文档</title>
<script src="http://s1.56img.com/script/lib/jquery/jquery-1.4.4.min.js" type="text/javascript"></script>
</head>
<body>
<table width="100%" cellpadding="0" align="center" class="listshow" border="0" cellspacing="0">
<tr>
<td colspan="4" align="center">班次</td>
</tr>
<tr>
<td class="black" width="30%" align="center" height="150">
<select id="fb_list" multiple="multiple" style="text-align:center;width:300px;height:200px;"></select>
</td>
<td align="center" width="5%">
<input type="button" id="add" value="添加>>" />
<input type="button" id="delete" value="<<删除" />
</td>
<td class="black" width="30%" align="center">
<select id="select_list" multiple="multiple" style=" text-align:center;width:300px;height:200px;"></select>
</td>
</tr>
</table>
<script>
$(document).ready(function(){
for(var i=1;i<=5;i++) {
$("#fb_list").append("<option value='"+i+"'>班次00"+i+"</option>");
};
$("#add").click(function(){
if($("#fb_list option:selected").length>0) {
$("#fb_list option:selected").each(function(){
$("#select_list").append("<option value='"+$(this).val()+"'>"+$(this).text()+"</option");
$(this).remove();
})
}else {
alert("请选择要添加的班次!");
}
});
$("#delete").click(function() {
if($("#select_list option:selected").length>0) {
$("#select_list option:selected").each(function(){
$("#fb_list").append("<option value='"+$(this).val()+"'>"+$(this).text()+"</option");
$(this).remove();
})
}else {
alert("请选择要删除的班次!");
}
})
})
</script>
</body>
</html>
- 左侧数据移到右侧 select 实现法
- CSSS实现右侧定宽左侧自适应
- ifame实现左侧导航栏右侧内容
- 递归算法:将数据分为两部分,递归将数据从左侧移右侧实现全排列
- css实现右侧固定宽度,左侧宽度自适应
- PopupWindow实现右侧、左侧和底部弹出菜单
- css实现右侧固定宽度,左侧宽度自适应
- PopupWindow实现右侧、左侧和底部弹出菜单
- 老生长谈:CSS实现右侧固定宽度,左侧宽度自适应
- PopupWindow实现右侧、左侧和底部弹出菜单
- css实现右侧固定宽度,左侧宽度自适应
- PopupWindow实现右侧、左侧和底部弹出菜单
- bootstrap如何实现左侧导航栏,右侧网页
- QStackedWidget实现左侧列表与右侧控件关联
- HTML页面左侧菜单栏切换实现右侧主体内容改变
- ajax实现点击左侧菜单,右侧加载不同网页
- css实现左侧固定宽度,右侧宽度自适应
- css实现右侧固定宽度,左侧宽度自适应
- jboss安装、环境变量配置、部署
- comments of word2vec code
- XSLT
- kernel networking两个重要结构体
- Upload_File 上传的用法和判断上传类型的说明
- 左侧数据移到右侧 select 实现法
- 2014 --人人网笔试算法汇总
- 2013.9.10兰亭集势 (技术笔试题) 部分题总结
- VS2012 开发SharePoint 2013 声明式workflow action(activity)之 HelloWorld
- 票据承兑
- How to add custom property in custom webpart using VS 2012
- Hashtable和HashMap的差异化分析
- php发送get、post请求的几种方法
- Win32 SDK函数MessageBox的模拟实现(C语言版)