<tr>
<td></td>
<td rowspan="5" style="overflow-y: scroll;height:176px;width:95%;display: inline-block;" id="selected">
<span class="span"><input type="checkbox">测试站点1<br></span>
<span class="span"><input type="checkbox">测试站点2<br></span>
<span class="span"><input type="checkbox">测试站点3<br></span>
<span class="span"><input type="checkbox">测试站点4<br></span>
<span class="span"><input type="checkbox">测试站点5<br></span>
<span class="span"><input type="checkbox">测试站点6<br></span>
<span class="span"><input type="checkbox">测试站点7<br></span>
<span class="span"><input type="checkbox">测试站点8<br></span>
<span class="span"><input type="checkbox">测试站点9<br></span>
<span class="span"><input type="checkbox">测试站点10<br></span>
</td>
<td class="text-c">
<a href="javascript:;" type="button" class="btn btn-primary radius" id="right" style="margin-bottom: 5px;">></a><br>
<a href="javascript:;" type="button" class="btn btn-primary radius" id="allright" style="margin-bottom: 5px;">>></a><br>
<a href="javascript:;" type="button" class="btn btn-primary radius" id="left" style="margin-bottom: 5px;"><</a><br>
<a href="javascript:;" type="button" class="btn btn-primary radius" id="allleft"><<</a>
</td>
<td rowspan="5" style="overflow-y: scroll;height:176px;width:95%;display: inline-block;" id="uncheck">
</td>
</tr>
$("#left").on("click",function(){
if($("#selected").html("")){
$(".span").each(function(){
$(this).children().is(":checked").prepend($("#selected").html($('#uncheck input[type=checkbox]:checked').parent()));
$('input[type=checkbox]:checked').remove();
});
}
else {
$("#selected").html(append($("#uncheck").html()));
}
});
$("#right").on("click",function(){
if($("#uncheck").html("")){
$(".span").each(function(){
$(this).children().is(":checked").prepend($("#uncheck").html($('#selected input[type=checkbox]:checked').parent()));
$('input[type=checkbox]:checked').remove();
});
}
else {
$("#uncheck").html(append($("#selected").html()));
}
});
$("#allright").on("click",function(){
if($("#uncheck").html("")) {
$(".span").each(function () {
$(this).children().is(":checked").prepend($("#uncheck").html($('#selected input[type=checkbox]:checked').parent()));
$('input[type=checkbox]:checked').remove();
});
}
else {
$("#uncheck").html(append($("#selected").html()));
}
});
$("#allleft").on("click",function(){
if($("#selected").html("")) {
$(".span").each(function () {
$(this).children().is(":checked").prepend($("#selected").html($('#uncheck input[type=checkbox]:checked').parent()));
$('input[type=checkbox]:checked').remove();
});
}
else {
$("#selected").html(append($("#uncheck").html()));
}
});
</script>
我点了过后能移动,但是移动回来的话就会把我之前的重叠掉了。
</td>
</tr>
$("#right").on("click",function(){
if($("#uncheck").html("")){
你这里不是自己清空了。。,你是要判断什么东东,获取控件html代码不要传递参数值