Home > Web Front-end > JS Tutorial > JQuery drop-down box application example introduction_jquery

JQuery drop-down box application example introduction_jquery

WBOY
Release: 2016-05-16 16:51:34
Original
866 people have browsed it

To implement data movement between two drop-down boxes, add

Copy code The code is as follows:

$(' #add').click(function(){
var $options = $('#select1 option:selected'); //Get the selected item
var $remove = $options.remove();
$remove.appenTo('#select2');
});

Simplified as follows
Copy code The code is as follows:

$('#add').click(function(){
var $options = $('#select1 option:selected'); //Get the selected item
$remove.appenTo('#select2');
});
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template