zoukankan
html css js c++ java
写的一个双向选择器(JS)
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
>
<
meta
http-equiv
="Content-Type"
content
="text/html; charset=gb2312"
/>
<
title
>
Web双向选择器
</
title
>
<
script
type
="text/javascript"
language
="javascript"
>
function
moveItem(dest, source)
{
var
dest
=
(
typeof
dest
==
"
string
"
?
document.getElementById(dest): dest );
var
source
=
(
typeof
source
==
"
string
"
?
document.getElementById(source) : source );
if
( source.tagName.toLowerCase()
!=
"
select
"
||
dest.tagName.toLowerCase()
!=
"
select
"
)
return
;
for
( index
=
source.length
-
1
; index
>=
0
; index
--
)
{
if
( source[index].selected )
{
dest.length
++
;
dest[dest.length
-
1
].id
=
source[index].id;
dest[dest.length
-
1
].value
=
source[index].value;
dest[dest.length
-
1
].text
=
source[index].text;
source[index]
=
null
;
}
}
}
</
script
>
<
style
type
="text/css"
>
select
{
}
{
margin
:
-2px
;
}
</
style
>
</
head
>
<
body
>
<
table
width
="200"
border
="0"
cellpadding
="0"
cellspacing
="0"
>
<
tr
>
<
td
>
<
select
size
="6"
multiple
="multiple"
id
="left"
ondblclick
="moveItem(right,this)"
>
<
option
value
="def"
>
ListItem1
</
option
>
<
option
value
="abcd"
>
ListItem2
</
option
>
</
select
>
</
td
>
<
td
>
<
input
type
="button"
value
=" > "
name
="btnRight"
onclick
="moveItem(right,left)"
/>
<
input
type
="button"
value
=" < "
onclick
="moveItem(left,right)"
id
="btn"
name
="btnLeft"
/>
</
td
>
<
td
>
<
select
size
="6"
multiple
="multiple"
id
="right"
ondblclick
="moveItem(left,this)"
>
<
option
value
="abc"
>
ListItemm3
</
option
>
<
option
value
="def"
>
ListItem4
</
option
>
<
option
value
="abcd"
>
ListItem5
</
option
>
<
option
value
="abc"
>
ListItem6
</
option
>
<
option
value
="def"
>
ListItem7
</
option
>
<
option
value
="abcd"
>
ListItem8
</
option
>
</
select
>
</
td
>
</
tr
>
</
table
>
</
body
>
</
html
>
查看全文
相关阅读:
根分区/tmp满了,卸载home添加给根分区
Docker容器技术教程
使用vscode访问和编辑远程服务器文件
使用 VS Code 远程连接Linux服务器告别xshell
Docker安装参考文档记录
yolov5在Centos系统上部署的环境搭建
YOLOV5四种网络结构的比对
k8s部署kube-state-metrics组件
Kubernetes集群部署Prometheus和Grafana
Prometheus介绍
原文地址:https://www.cnblogs.com/CSharp/p/416991.html
最新文章
小程序页面互相传值的几种方式
spring 实战 (3)—— JPA
java实现数据的Excel导出, 自定义导出字段, 转换字典值
JavaWeb案例:使用response实现重定向
《零基础看得懂的C语言入门教程 》
C语言这么厉害,它自身又是用什么语言写的?编写过程被称为自举!
解密程序员的编程框架背景都是黑色的!为什么没人去调整呢?
NET5 开启静态文件 前后端一起部署
TCP连接下出现固定的40ms左右延迟的原因(含使用ASIO库时的同样现象)
Linux下的零拷贝技术
热门文章
git http 免密码
反汇编指令objdump的使用
另一种查看库文件依赖的方法
保证多线程程序稳定的一些要点
当通过ssh连接的git突然向你要密码才有pull代码时的解决办法
无人驾驶与机器人领域的中间件与架构设计(一)
efficient c++核心点
Linux Core Dump
centos7安装图形化界面图
linux系统Give root password for maintenance解决办法
Copyright © 2011-2022 走看看