Create multiple dropdowns from a selection from the first dropdown

Create multiple dropdowns from a selection from the first dropdown

I am trying to create multiple dropdowns based on the number selected in the first dropdown. Please help. I am fairly new to jQuery.

Here is the code:

HTML CODE:

<SELECT id="rooms">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
</SELECT>
<div id="holderAdults"></div>

JQUERY CODE:

<script type='text/javascript'>//<![CDATA[ 
$(function(addAdults){
$("#rooms").change(function(addAdults){

    // The easiest way is of course to delete all textboxes before adding new ones
    //$("#holder").html("");

var count = $("#holderAdults select").size();
    var requested = parseInt($("#rooms").val(),10);
    
    if (requested > count) {
        for(i=count; i<requested; i++) {
 
    $('#holderAdults select').add('<option value="1">1</option>');

var $selectend = $('<select/><br/>');
      $("#holderAdults").append($selectend);
        }
    }
    else if (requested < count) {
        var x = requested - 1;
        $("#holderAdults select:gt(" + x + ")").remove();
    }

});
});//]]>  

</script>