Ajax

```
$(document).ready(function(){
          $("#diklat").change(function(){
            var diklat = $("#diklat").val();
            $.ajax({
                url: "function.php",
                data: {'action': 'diklat'},
                cache: false,
                success: function(msg){
                    $("#angkatan").html(msg);
                }
            });
          });

```

PHP

```
    $get_action = $_GET['action'];
if($get_action=='diklat'){
        $diklat = $_GET['diklat'];
        $angkatan = mysql_query("SELECT id,name FROM batches WHERE IdMasterDiklat='$diklat' order by id");
        echo "<option>-- Pilih Angkatan --</option>";
        while($p = mysql_fetch_array($angkatan)){
            echo "<option value=\"".$p['id']."\">".$p['name']."</option>\n";
        }
    }

```

The value didnt include in my ajax, ajax only read echo. how to get that value