dropdown is getting populated and not getting trimmed
<p>I am dynamically populating the dropdown using jquery . Its working fine but every time it executes it adds to the dropdownlist and it doesnot remove the previous values from the dropdown.</p>

<p>Code I am using to dynamiccally populate the dropdown is :</p>

<pre><code> $(document).ready(function() { 
                $("#diselc").change(function(){ 
                    fillOptions('diselc','diselchild'); 
                    }); 
            }); 
            function fillOptions(parentId,ddId) {
                alert("atleast the call is being made in the fillOptions"+ddId);
                var dd = $('#' + ddId); 
                alert("the value being passed is "+dd);
                var jsonURL = '/docRuleTool/DataRetrival.do?disease_name='+ $('#' + parentId + ' :selected').val(); 
                $.getJSON(jsonURL, function(opts)
                {
                alert("just after calling the servlet stuff ");
                    $('&gt;option', dd).remove(); // Clean old options first. 
                    if (opts) { 
                        $.each(opts, function(key, value) { 
                            dd.append($('&lt;option/&gt;').val(key).text(value)); 
                        }); 
                    } else { 
                        dd.append($('&lt;option/&gt;').text("Please select parent")); 
                    } 
                }); 


            } 
</code></pre>
