Create a multiple dropdown with jquery - Javascript jQuery

Javascript examples for jQuery:Select Dropdown

Description

Create a multiple dropdown with jquery

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-compat-git.js"></script> 
  <script type="text/javascript">
    $(window).on('load', function() {
$(function() {/*from  w  w  w .  ja  va  2  s.c  om*/
    var select = $('<select />', {
        'id': 'my',
        'multiple': true,
        'name': 'my[]'
    }).attr('data-rel', 'chosen');
    console.log(select[0]);
});
    });

      </script> 
 </head> 
 <body>  
 </body>
</html>

Related Tutorials