I’m trying to copy the <options> HTML Codes from one select list to another. I have tested the script below, but it does not work.
I have tested with an ‘alert’ function, but it seems to only display the values within the previous options.
would anyone be able to recommend what I should use? Thank you!
$("select[name='NHIndexNo" + tablecounter + "_" + rowCount + "'] option").each(function(){
$("select[name='NHIndexNo" + tablecounter + "_" + (rowCount+1) + "'] option").appendto($(this).val());
});
jQuery:
HTML:
Demo: http://jsfiddle.net/LbPAq/1