html drop down with javascript,Jquery
<p>Am using drop down and in change of the drop down am calling
    a javascript.In the javascript am changing the content of table
    class using jquery.Now the problem is if my dropdown needs to be
    changed again,it is not all since Iam changing the content in javascript.</p>

<pre><code>   function filterbyaptno(){
         var idno = document.getElementById("aplist").value;
         alert(idno);
          $.ajax({
           url:address ,
           type: 'POST',                    
           data:"idno="+idno,
           success:function(result) { 
               var numRecords = parseInt(result.rows.length);
               if(numRecords&gt;0)
                {
                   var html = '';
                   for(var i = 0; i&lt;numRecords;i++)
                   {
                     html +='&lt;div&gt;&lt;table class="support" width="700" cellpadding="10px;"&gt;
                      &lt;tr bgcolor="#E8E8E8"&gt;&lt;td width="7";&gt;'+result.rows[i].firstname+'&lt;/td&gt;'
                     +'&lt;td width="350"&gt;'+result.rows[i].advicetoowners+'&lt;/td&gt;'
                     +'&lt;td width="7"&gt;'+result.rows[i].customdata+'&lt;/td&gt;&lt;tr&gt;&lt;/table&gt;&lt;/div&gt;'
                    }
                      $('.detais').replaceWith(html);//here i change the content of div
                }            
                 $(function() {
                        $('.droplist').change(function(){
                             filterbyaptno();//here i call javascript while dropdown change
                      });
                 });     

                }
           });  }
</code></pre>

<p>Can anyone suggest me what should i do to change the content accordngly to drop down values</p>
