JQuery create new select option
- by nav
Hi
I have the below functions in regular javascript creating select options. Is there a way I can do this with JQuery without having to use the form object?
function populate(form)
{
form.options.length = 0;
form.options[0] = new Option("Select a city / town in Sweden","");
form.options[1] = new Option("Melbourne","Melbourne");
}
Below is how I call the function above:
populate(document.form.county); //county is the id of the dropdownlist to populate.
Many Thanks,