9

Now your option 4 will be selected.

.attr() sometimes doesn't work in older jQuery versions, but you can use .prop(): I have a select field with some options in it. The option tag is created like an HTML string, and the select box is selected with the jQuery selector. If you enjoyed this post, please support the blog below. How can I set the default value for an HTML