Wednesday 15 September 2010

jquery - Add another line with 3 select menus -



jquery - Add another line with 3 select menus -

i have 3 select menus when button clicked

<button class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> add</button>

i want 3 dropdowns again, how can done?

if want same 3 dropdowns repeated, maybe should have construction this:

<div id="main_container"> <div class="select_container select_master"> <select 1 .... <select 2 .... <select 3 .... </div> </div>

then, provide button identifier. if don't have other buttons same classes, can utilize [one of many ways this]:

$('.btn .btn-primary .btn-sm').on('click', function() { var dropdowns = $('.select_master').clone(true); // true clone event handlers dropdowns.removeclass('select_master'); // need 1 master $('#main_container').append(dropdowns); });

jquery

No comments:

Post a Comment