좌우select 선택

2931 단어 웹 프런트엔드
좌우select 선택




Insert title here
	
	
		$(document).ready(function(){
			$("#left1").click(function(){
				var $first=$("select :selected:first");
				/*$("select :selected:first").remove();
				$("#rightSelectId").append($first);*/
				$("select :selected:first").appendTo($("#rightSelectId"));
				$("select :selected:first").prop("selected",false);// 
			});
			$("#left2").click(function(){
				$("select :selected").appendTo($("#rightSelectId"));
				$("select :selected").prop("selected",false);// 
				/*var $second=$("select :selected");
				$("select :selected:first").remove();
				$("#rightSelectId").append($second);*/
			});
			$("#left3").click(function(){
				/*var $third=$("option");
				$("#rightSelectId").append($third);*/
				$("option").appendTo($("#rightSelectId"));
				$("option").prop("selected",false);// 
			});
			$("#right1").click(function(){
				$("select :selected:first").appendTo($("#leftSelectId"));
			$("select :selected:first").prop("selected",false);// 
				/*var $first=$("select :selected:first");
				$("select :selected:first").remove();
				$("#leftSelectId").append($first);*/
				
			});
			$("#right2").click(function(){
				$("select :selected").appendTo($("#leftSelectId"));
				$("select :selected:first").prop("selected",false);// 
			/*	var $second=$("select :selected");
				$("select :selected:first").remove();
				$("#leftSelectId").append($second);*/
			});
			$("#right3").click(function(){
				$("option").appendTo($("#leftSelectId"));
				$("select :selected:first").prop("selected",false);// 
				/*var $third=$("option");
				$("#leftSelectId").append($third);*/
				//$("option").appendTo($("#rightSelectId"))
			});
		});
	
	
	


	






좋은 웹페이지 즐겨찾기