学习内容:
需求
用 JS 实现列表移动
实现代码
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>列表移动</title>
<script type="text/javascript" src="/static/jQuery-1.11/jquery-1.11.3.min.js">
</script>
<script>
function moveAll(srcId, targetId) {
// ('#' + targetId)拼接字符串
$('#' + targetId).append($("#" + srcId + " > option"));
}
function moveSelected(srcId, targetId) {
// ('