<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
function showDiv(select) {
    if (select.value == 0) {
        $("#select_suami_istri").hide();
    }
    if (select.value == 1) {
        $("#select_suami_istri").show();
    }
    if (select.value == 2) {
        $("#select_suami_istri").hide();
    }
}
</script>
<script type="text/javascript">
$('#province_id').change(function() {
    var province_id = $(this).val();
    $.ajax({
        type: 'POST',
        url: '<?= base_url('owner/kot_kab') ?>',
        data: 'province_id=' + province_id,
        success: function(response) {
            $('#kot_kab').html(response);
        }
    });
});

$('#kot_kab').change(function() {
    var kab_kot = $(this).val();
    $.ajax({
        type: 'POST',
        url: '<?= base_url('owner/kecamatan') ?>',
        data: 'kab_kot=' + kab_kot,
        success: function(response) {
            $('#nm_kec').html(response);
        }
    });
});

$('#nm_kec').change(function() {
    var kecamatan = $(this).val();
    $.ajax({
        type: 'POST',
        url: '<?= base_url('owner/nm_desabaru') ?>',
        data: 'kecamatan=' + kecamatan,
        success: function(response) {
            $('#nm_desa').html(response);
        }
    });
});
</script>