You’re overthinking it:
var country = document.getElementById("country");
country.options[country.options.selectedIndex].selected = true;
More Related Contents:
- What is the best way to add options to a select from a JavaScript object with jQuery?
- Get all Attributes from a HTML element with Javascript/jQuery
- Adding options to a using jQuery?
- Change the selected value of a drop-down list with jQuery
- How to populate a cascading Dropdown with JQuery
- jQuery get specific option tag text
- How do you remove all the options of a select box and then add one option and select it with jQuery?
- Get all attributes of an element using jQuery
- Hide select option in IE using jQuery
- Removing an item from a select box
- Set attribute without value
- Check if option is selected with jQuery, if not select a default
- Get list of data-* attributes using javascript / jQuery
- How to use jQuery to select a dropdown option?
- What is the most efficient way to sort an Html Select’s Options by value, while preserving the currently selected item?
- How to keep cascade dropdownlist selected items after form submit?
- Creating a select box with a search option
- Getting the User Agent with JavaScript
- jQuery remove options from select
- Close a SELECT dropdown list programmatically with Javascript/jQuery
- How to hide optgroup/option elements?
- Dynamically change Tweet Button “data-text” contents
- Can you have multiple lines in an element?
- Change from (+) symbol to (-) after click (function(){
- HTML5 Canvas toDataURL returns blank
- Loading scripts after page load?
- comparing 2 strings alphabetically for sorting purposes
- How can I remove all CSS classes using jQuery/JavaScript?
- AngularJS : ng-model binding not updating when changed with jQuery
- How to change tabs programmatically in jquery-ui 1.9?