title: how create another dropdown list with ajax?
body: <p>hello   i want when user choose the Iran the  that next to this load the city without loading !</p>
  
  <pre><code>&lt;select id="select2" name="street" class="cty street"&gt;
      &lt;option&gt;Iran&lt;/option&gt;
      &lt;option&gt;Japan&lt;/option&gt;
      &lt;option&gt;UnitedState&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;script type="text/javascript"&gt;
      $(document).ready(function(){
          $("#select2").click(function(){
              var key= $(".street").val();
              var shahrha=$("#select2 option:selected").text();
              var active =true;
              $.get("ajax.php", {key:key,shahrha:shahrha,active:active},function(data){
              $(".street").html(data); 
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>//------ajaxpage -----//</p>
  
  <pre><code>  if(isset($_GET["active"]) &amp;&amp; isset($_GET["key"]) &amp;&amp; isset($_GET["shahrha"])){
      $keyword=$_GET["key"];
      $shahr=$_GET["shahrha"];
      $sql="SELECT * FROM `tbl_detail` WHERE `street` like :name AND `shahr`=:sh";
      $result=$connect-&gt;prepare($sql);
      $k="%".$keyword."%";
      $result-&gt;bindParam(":sh",$shahr);
      $result-&gt;bindParam(":name",$k);
      $run=$result-&gt;execute();
      if($run){
      while($rows=$result-&gt;fetch(PDO::FETCH_ASSOC)){
      echo "&lt;select class='cty'&gt;&lt;option&gt;".$rows["street"]."&lt;/option&gt;&lt;/select&gt;";
              }
          }
          else{
          echo "dosnt exist";
  
          }
  
  
      }
  </code></pre>
  
  <p>i want to do that with ajax ! how can i do that ?</p>