{"id":257527,"date":"2024-05-23T20:04:27","date_gmt":"2024-05-23T20:04:27","guid":{"rendered":"https:\/\/namso-gen.co\/blog\/?p=257527"},"modified":"2024-05-23T20:04:27","modified_gmt":"2024-05-23T20:04:27","slug":"how-to-set-default-selected-value-in-dropdown-using-jquery-2","status":"publish","type":"post","link":"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/","title":{"rendered":"How to set default selected value in dropdown using jQuery?"},"content":{"rendered":"<p>jQuery is a popular JavaScript library that simplifies the process of manipulating HTML elements and performing various actions on web pages. One common question web developers often encounter is how to set a default selected value in a dropdown using jQuery. In this article, we will explore the solution to this problem and address other related frequently asked questions.<\/p>\n<p>**How to set default selected value in dropdown using jQuery?**<br \/>\nTo set a default selected value in a dropdown using jQuery, you can use the `.val()` function to assign the desired value to the dropdown. For example, if you have a dropdown with an id of &#8220;myDropdown&#8221; and you want to set the option with a value of &#8220;default&#8221; as the default selected value, you can use the following code:<br \/>\n&#8220;`<br \/>\n$(&#8220;#myDropdown&#8221;).val(&#8220;default&#8221;);<br \/>\n&#8220;`<br \/>\nThis will automatically select the option with the value &#8220;default&#8221; in the dropdown.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_62 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#1_How_can_I_set_a_default_selected_value_based_on_the_options_text_instead_of_its_value\" title=\"1. How can I set a default selected value based on the option&#8217;s text instead of its value?\">1. How can I set a default selected value based on the option&#8217;s text instead of its value?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#2_Can_I_set_the_default_selected_value_dynamically_based_on_some_condition\" title=\"2. Can I set the default selected value dynamically based on some condition?\">2. Can I set the default selected value dynamically based on some condition?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#3_How_can_I_select_the_default_value_after_the_dropdown_is_populated_dynamically\" title=\"3. How can I select the default value after the dropdown is populated dynamically?\">3. How can I select the default value after the dropdown is populated dynamically?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#4_What_if_the_default_selected_value_does_not_exist_in_the_dropdown_options\" title=\"4. What if the default selected value does not exist in the dropdown options?\">4. What if the default selected value does not exist in the dropdown options?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#5_Can_I_set_the_default_value_for_a_multi-select_dropdown\" title=\"5. Can I set the default value for a multi-select dropdown?\">5. Can I set the default value for a multi-select dropdown?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#6_How_can_I_set_the_first_option_as_the_default_selected_value\" title=\"6. How can I set the first option as the default selected value?\">6. How can I set the first option as the default selected value?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#7_How_can_I_remove_the_default_selection_from_the_dropdown\" title=\"7. How can I remove the default selection from the dropdown?\">7. How can I remove the default selection from the dropdown?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#8_Can_I_set_the_default_selected_value_in_a_cascading_dropdown\" title=\"8. Can I set the default selected value in a cascading dropdown?\">8. Can I set the default selected value in a cascading dropdown?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#9_Can_I_set_the_default_selected_value_for_a_dropdown_inside_a_table\" title=\"9. Can I set the default selected value for a dropdown inside a table?\">9. Can I set the default selected value for a dropdown inside a table?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#10_How_can_I_change_the_default_selected_value_dynamically_through_user_interaction\" title=\"10. How can I change the default selected value dynamically through user interaction?\">10. How can I change the default selected value dynamically through user interaction?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#11_Does_using_jQuery_to_set_the_default_selected_value_have_any_performance_impact\" title=\"11. Does using jQuery to set the default selected value have any performance impact?\">11. Does using jQuery to set the default selected value have any performance impact?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#12_Can_I_set_the_default_selected_value_for_a_disabled_dropdown\" title=\"12. Can I set the default selected value for a disabled dropdown?\">12. Can I set the default selected value for a disabled dropdown?<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"1_How_can_I_set_a_default_selected_value_based_on_the_options_text_instead_of_its_value\"><\/span>1. How can I set a default selected value based on the option&#8217;s text instead of its value?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTo set a default selected value based on the option&#8217;s text, you can use the `.filter()` function along with the `.val()` function. This allows you to select the option with the desired text and set it as the default selected option.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Can_I_set_the_default_selected_value_dynamically_based_on_some_condition\"><\/span>2. Can I set the default selected value dynamically based on some condition?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, you can set the default selected value dynamically based on some condition by using conditional statements in your jQuery code. Evaluate the condition and set the desired value accordingly.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_How_can_I_select_the_default_value_after_the_dropdown_is_populated_dynamically\"><\/span>3. How can I select the default value after the dropdown is populated dynamically?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nOnce the dropdown has been populated dynamically, you can use the `.val()` function to select the default value. Make sure to execute this code after the dropdown has been populated.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_What_if_the_default_selected_value_does_not_exist_in_the_dropdown_options\"><\/span>4. What if the default selected value does not exist in the dropdown options?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nIf the default selected value does not exist in the dropdown options, the dropdown will display no selected option. It is essential to ensure that the default value exists in the dropdown options.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_Can_I_set_the_default_value_for_a_multi-select_dropdown\"><\/span>5. Can I set the default value for a multi-select dropdown?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, you can use the same `.val()` function to set the default selected option in a multi-select dropdown. However, instead of providing a single value, you need to provide an array of values.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"6_How_can_I_set_the_first_option_as_the_default_selected_value\"><\/span>6. How can I set the first option as the default selected value?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTo set the first option as the default selected value, you can simply use the `.val()` function without passing any value. This will automatically select the first option in the dropdown.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"7_How_can_I_remove_the_default_selection_from_the_dropdown\"><\/span>7. How can I remove the default selection from the dropdown?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTo remove the default selection from the dropdown, you can use the `.val()` function with an empty string as the value. This will deselect all options in the dropdown.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"8_Can_I_set_the_default_selected_value_in_a_cascading_dropdown\"><\/span>8. Can I set the default selected value in a cascading dropdown?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, you can set the default selected value in a cascading dropdown by chaining multiple `.val()` functions. Use the values from the parent dropdown to set the default selection in the child dropdown.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"9_Can_I_set_the_default_selected_value_for_a_dropdown_inside_a_table\"><\/span>9. Can I set the default selected value for a dropdown inside a table?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, you can set the default selected value for a dropdown inside a table by using its unique id or relative selector to target the dropdown element.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"10_How_can_I_change_the_default_selected_value_dynamically_through_user_interaction\"><\/span>10. How can I change the default selected value dynamically through user interaction?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTo change the default selected value dynamically based on user interaction, you can use event handlers like `.change()` or `.click()` to capture the user&#8217;s action and update the default selection accordingly.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"11_Does_using_jQuery_to_set_the_default_selected_value_have_any_performance_impact\"><\/span>11. Does using jQuery to set the default selected value have any performance impact?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nNo, setting the default selected value using jQuery does not have any significant performance impact. jQuery is designed to be efficient, and the `.val()` function is optimized for manipulating dropdowns.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"12_Can_I_set_the_default_selected_value_for_a_disabled_dropdown\"><\/span>12. Can I set the default selected value for a disabled dropdown?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nNo, it is not possible to set the default selected value for a disabled dropdown. Disabled dropdowns prevent user interaction, and any attempt to set a default selected value will be disregarded.<\/p>\n<p>In conclusion, setting a default selected value in a dropdown using jQuery is a straightforward task. By utilizing the `.val()` function, you can effortlessly select the desired value. Furthermore, jQuery provides flexibility and convenience for dynamically setting default values and performing various actions on dropdowns, making it a valuable tool for web developers.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>jQuery is a popular JavaScript library that simplifies the process of manipulating HTML elements and performing various actions on web pages. One common question web developers often encounter is how to set a default selected value in a dropdown using jQuery. In this article, we will explore the solution to this problem and address other &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to set default selected value in dropdown using jQuery?\" class=\"read-more button\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#more-257527\">Read more<span class=\"screen-reader-text\">How to set default selected value in dropdown using jQuery?<\/span><\/a><\/p>\n","protected":false},"author":65,"featured_media":107420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86279],"tags":[],"class_list":["post-257527","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to set default selected value in dropdown using jQuery?<\/title>\n<meta name=\"description\" content=\"jQuery is a popular JavaScript library that simplifies the process of manipulating HTML elements and performing various actions on web pages. One common\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to set default selected value in dropdown using jQuery?\" \/>\n<meta property=\"og:description\" content=\"jQuery is a popular JavaScript library that simplifies the process of manipulating HTML elements and performing various actions on web pages. One common\" \/>\n<meta property=\"og:url\" content=\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/synchronyfinancial\" \/>\n<meta property=\"article:published_time\" content=\"2024-05-23T20:04:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2024\/03\/faq.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Timothy Mathis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@synchrony\" \/>\n<meta name=\"twitter:site\" content=\"@synchrony\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Timothy Mathis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/\"},\"author\":{\"name\":\"Timothy Mathis\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318\"},\"headline\":\"How to set default selected value in dropdown using jQuery?\",\"datePublished\":\"2024-05-23T20:04:27+00:00\",\"dateModified\":\"2024-05-23T20:04:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/\"},\"wordCount\":735,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"articleSection\":[\"Learn\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/\",\"name\":\"How to set default selected value in dropdown using jQuery?\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\"},\"datePublished\":\"2024-05-23T20:04:27+00:00\",\"dateModified\":\"2024-05-23T20:04:27+00:00\",\"description\":\"jQuery is a popular JavaScript library that simplifies the process of manipulating HTML elements and performing various actions on web pages. One common\",\"breadcrumb\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/namso-gen.co\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to set default selected value in dropdown using jQuery?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"description\":\"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co\",\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/namso-gen.co\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"contentUrl\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"width\":500,\"height\":164,\"caption\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\"},\"image\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/synchronyfinancial\",\"https:\/\/twitter.com\/synchrony\",\"https:\/\/www.youtube.com\/synchronyfinancial\",\"https:\/\/www.instagram.com\/synchrony\",\"https:\/\/www.linkedin.com\/company\/synchrony-financial\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318\",\"name\":\"Timothy Mathis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"Timothy Mathis\"},\"description\":\"Guest author Timothy Mathis has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to set default selected value in dropdown using jQuery?","description":"jQuery is a popular JavaScript library that simplifies the process of manipulating HTML elements and performing various actions on web pages. One common","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/","og_locale":"en_US","og_type":"article","og_title":"How to set default selected value in dropdown using jQuery?","og_description":"jQuery is a popular JavaScript library that simplifies the process of manipulating HTML elements and performing various actions on web pages. One common","og_url":"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/","og_site_name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","article_publisher":"https:\/\/www.facebook.com\/synchronyfinancial","article_published_time":"2024-05-23T20:04:27+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2024\/03\/faq.png","type":"image\/png"}],"author":"Timothy Mathis","twitter_card":"summary_large_image","twitter_creator":"@synchrony","twitter_site":"@synchrony","twitter_misc":{"Written by":"Timothy Mathis","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#article","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/"},"author":{"name":"Timothy Mathis","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318"},"headline":"How to set default selected value in dropdown using jQuery?","datePublished":"2024-05-23T20:04:27+00:00","dateModified":"2024-05-23T20:04:27+00:00","mainEntityOfPage":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/"},"wordCount":735,"commentCount":0,"publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"articleSection":["Learn"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/","url":"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/","name":"How to set default selected value in dropdown using jQuery?","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/#website"},"datePublished":"2024-05-23T20:04:27+00:00","dateModified":"2024-05-23T20:04:27+00:00","description":"jQuery is a popular JavaScript library that simplifies the process of manipulating HTML elements and performing various actions on web pages. One common","breadcrumb":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/namso-gen.co\/blog\/how-to-set-default-selected-value-in-dropdown-using-jquery-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/namso-gen.co\/blog\/"},{"@type":"ListItem","position":2,"name":"How to set default selected value in dropdown using jQuery?"}]},{"@type":"WebSite","@id":"https:\/\/namso-gen.co\/blog\/#website","url":"https:\/\/namso-gen.co\/blog\/","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","description":"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co","publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/namso-gen.co\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/namso-gen.co\/blog\/#organization","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","url":"https:\/\/namso-gen.co\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","contentUrl":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","width":500,"height":164,"caption":"Namso Gen Blog - Free Credit Card Generator [100% Valid]"},"image":{"@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/synchronyfinancial","https:\/\/twitter.com\/synchrony","https:\/\/www.youtube.com\/synchronyfinancial","https:\/\/www.instagram.com\/synchrony","https:\/\/www.linkedin.com\/company\/synchrony-financial"]},{"@type":"Person","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318","name":"Timothy Mathis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"Timothy Mathis"},"description":"Guest author Timothy Mathis has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here."}]}},"_links":{"self":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/257527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/comments?post=257527"}],"version-history":[{"count":0,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/257527\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media\/107420"}],"wp:attachment":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media?parent=257527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/categories?post=257527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/tags?post=257527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}