accessing an id within another id jquery
<p>Here's what I'm trying to do. I'm trying to get a block of code written in div then modify some of the div/id to different names and so I can send them to the form with unique names. Any ideas on how to do this?
My idea right now is to first set the variable to to the div that I'm copying then access the other div's within it, but that doesn't seem to work. Any ideas?</p>

<pre><code>var i = 0;
    $("#custom_rates").click(function() 
    { 
        var sublet_dates_seen = $("#sublet_dates_seen").clone();
        // all id's below are within #sublet_dates_seen
        sublet_dates_seen.getElementById('#CustomPricePerNightPrice').attr('name','data[CustomPricePerNight][price][' + i ']');
        sublet_dates_seen.getElementById(('#CustomPricePerNightStartDateMonth').attr('name','data[CustomPricePerNight][start_date][month][' + i ']');
        sublet_dates_seen.getElementById(('#CustomPricePerNightStartDateDay').attr('name','data[CustomPricePerNight][start_date][day][' + i ']');
        sublet_dates_seen.getElementById(('#CustomPricePerNightStartDateYear').attr('name','data[CustomPricePerNight][start_date][year][' + i ']');
        sublet_dates_seen.getElementById(('#CustomPricePerNightEndDateMonth').attr('name','data[CustomPricePerNight][end_date][month][' + i ']');
        sublet_dates_seen.getElementById(('#CustomPricePerNightEndDateDay').attr('name','data[CustomPricePerNight][end_date][day][' + i ']');
        sublet_dates_seen.getElementById(('#CustomPricePerNightEndDateYear').attr('name','data[CustomPricePerNight][end_date][year][' + i ']');
        sublet_dates_seen.getElementById(('#CustomPricePerNightMinimumNights').attr('name','data[CustomPricePerNight][minimum_nights][' + i ']');
        sublet_dates_seen.getElementById(('#CustomPricePerNightMaximumNights').attr('name','data[CustomPricePerNight][maximum_nights][' + i ']');        
        sublet_dates_seen.appendTo(".avi_specialrates");
        i = i + 1;
    return false;
    }); 
</code></pre>
