1<script src="https://code.jquery.com/jquery-2.1.1.min.js"
2 type="text/javascript"></script>
3<script>
4function getState() {
5 var str='';
6 var val=document.getElementById('country-list');
7 for (i=0;i< val.length;i++) {
8 if(val[i].selected){
9 str += val[i].value + ',';
10 }
11 }
12 var str=str.slice(0,str.length -1);
13
14 $.ajax({
15 type: "GET",
16 url: "get_state.php",
17 data:'country_id='+str,
18 success: function(data){
19 $("#state-list").html(data);
20 }
21 });
22}
23</script>