本文介绍了如何复制< option>从一个< select>中选择到另一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用这里的双面多选 www.stevefenton.co .uk/cmsfiles/assets/File/twosidemultiselect.html ,并且需要使用JQuery将右侧multiselect中的选定选项添加到另一个选择列表中.有人曾经做过此事,并且知道这样做的快速方法吗?
I am using the two sided multi select found here www.stevefenton.co.uk/cmsfiles/assets/File/twosidedmultiselect.html and need to add the selected options in the right hand multiselect to another select list with JQuery. Has anyone had to do this before and knows a quick way of doing this?
var selectedOptions = $("#myselect")[0].options;将获得这些选项,但是如何将这些选项写入另一个选择?
var selectedOptions = $("#myselect")[0].options; will get the options but how to write these to the other select?
推荐答案var $options = $("#myselect > option").clone(); $('#secondSelectId').append($options);
实时演示
更多推荐
如何复制< option>从一个< select>中选择到另一个?
发布评论