I have a javascript file (country.js) which has some function written like getcountry() and setcountry() etc. getCountry has the list of all the countries. Now I want to use this function to show all countries in a combo-box on my web page. but I do not how to call this function in html section.
this is some part of country.js file.
------------------Country.js--------------------------
function _getCountries() {
}
function _setCountries() {
_countries.push({ CountryID: 1, Name: 'Germany' });
_countries.push({ CountryID: 2, Name: 'India' });
_countries.push({ CountryID: 3, Name: 'China' });
.................................................
}
I am trying something like that but do not know how to use this function in html part. I am new on web development.
-------------HTML--------------------------
<div>
<select onchange="Country()">
//what to do in this section?
</select>
</div>
___________ javaScript__________________
function Country{
getCountries();
//what to do in this section?
}