{"id":7993,"date":"2012-09-23T23:55:52","date_gmt":"2012-09-23T18:25:52","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=7993"},"modified":"2012-09-23T23:55:52","modified_gmt":"2012-09-23T18:25:52","slug":"dynamically-changing-select-value-of-jquery-mobile-select-box","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/","title":{"rendered":"Dynamically changing select value of jQuery Mobile select box"},"content":{"rendered":"<p>jQuery mobile gives you a very beautiful UI which is compatible with all popular mobile device platforms and i must say its very easy to learn as well.<br \/>\nIt gives you a very nice select menu instead of typical select box that we see on our web site, for this we just need to add attribute <strong>&#8220;data-native-menu&#8221;<\/strong> in our select and we are done, e.g;<br \/>\n[java]<br \/>\n&lt;select name=&quot;reminderSettings&quot; id=&quot;reminderSettings&quot; data-native-menu=&quot;false&quot;&gt;<br \/>\n&lt;option value=&quot;1&quot; selected=&quot;selected&quot;&gt;1 day before&lt;\/option&gt;<br \/>\n&lt;option value=&quot;2&quot;&gt;2 days before&lt;\/option&gt;<br \/>\n&lt;option value=&quot;3&quot;&gt;3 days before&lt;\/option&gt;<br \/>\n&lt;option value=&quot;5&quot;&gt;5 days before&lt;\/option&gt;<br \/>\n&lt;\/select&gt;<br \/>\n[\/java]<\/p>\n<p>But the problem occurs when we need to change the selected value dynamically. Usually we write the following code to change the selected values of select box.<br \/>\n[java]<br \/>\nfunction setOptionValue(value){<br \/>\n  var reminderSettings = $(&quot;#reminderSettings&quot;);<br \/>\n  reminderSettings.val(value).attr(&#8216;selected&#8217;, true).siblings(&#8216;option&#8217;).removeAttr(&#8216;selected&#8217;);<br \/>\n}<br \/>\n[\/java]<br \/>\nIt will definitely change the selected value but the UI will not reflect it, to reflect this on the UI as well we need to refresh our select box.<br \/>\n[java]<br \/>\n    reminderSettings.selectmenu(&quot;refresh&quot;, true);<br \/>\n[\/java] <\/p>\n<p>We need to add the above line after changing our select value and its done.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>jQuery mobile gives you a very beautiful UI which is compatible with all popular mobile device platforms and i must say its very easy to learn as well. It gives you a very nice select menu instead of typical select box that we see on our web site, for this we just need to add [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":10,"footnotes":""},"categories":[1],"tags":[970,1013,1014],"class_list":["post-7993","post","type-post","status-publish","format-standard","hentry","category-technology","tag-jquery-mobile","tag-refresh-jquery-mobile-select","tag-select-option-value-in-jquery-mobile"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"jQuery mobile gives you a very beautiful UI which is compatible with all popular mobile device platforms and i must say its very easy to learn as well. It gives you a very nice select menu instead of typical select box that we see on our web site, for this we just need to add\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Uday Pratap Singh\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Dynamically changing select value of jQuery Mobile select box | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"jQuery mobile gives you a very beautiful UI which is compatible with all popular mobile device platforms and i must say its very easy to learn as well. It gives you a very nice select menu instead of typical select box that we see on our web site, for this we just need to add\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Dynamically changing select value of jQuery Mobile select box | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"jQuery mobile gives you a very beautiful UI which is compatible with all popular mobile device platforms and i must say its very easy to learn as well. It gives you a very nice select menu instead of typical select box that we see on our web site, for this we just need to add\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/dynamically-changing-select-value-of-jquery-mobile-select-box\\\/#article\",\"name\":\"Dynamically changing select value of jQuery Mobile select box | TO THE NEW Blog\",\"headline\":\"Dynamically changing select value of jQuery Mobile select box\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/uday\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2012-09-23T23:55:52+05:30\",\"dateModified\":\"2012-09-23T23:55:52+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/dynamically-changing-select-value-of-jquery-mobile-select-box\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/dynamically-changing-select-value-of-jquery-mobile-select-box\\\/#webpage\"},\"articleSection\":\"Technology, jQuery Mobile, refresh jquery mobile select, select option value in jquery mobile\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/dynamically-changing-select-value-of-jquery-mobile-select-box\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/dynamically-changing-select-value-of-jquery-mobile-select-box\\\/#listItem\",\"name\":\"Dynamically changing select value of jQuery Mobile select box\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/dynamically-changing-select-value-of-jquery-mobile-select-box\\\/#listItem\",\"position\":3,\"name\":\"Dynamically changing select value of jQuery Mobile select box\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/uday\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/uday\\\/\",\"name\":\"Uday Pratap Singh\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/dynamically-changing-select-value-of-jquery-mobile-select-box\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/d4c98503-ff55-4112-8fc2-e3c4fcc6fc3a_282-Uday-Pratap-Singh-PROFILEPICTURE.jpeg\",\"width\":96,\"height\":96,\"caption\":\"Uday Pratap Singh\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/dynamically-changing-select-value-of-jquery-mobile-select-box\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/dynamically-changing-select-value-of-jquery-mobile-select-box\\\/\",\"name\":\"Dynamically changing select value of jQuery Mobile select box | TO THE NEW Blog\",\"description\":\"jQuery mobile gives you a very beautiful UI which is compatible with all popular mobile device platforms and i must say its very easy to learn as well. It gives you a very nice select menu instead of typical select box that we see on our web site, for this we just need to add\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/dynamically-changing-select-value-of-jquery-mobile-select-box\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/uday\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/uday\\\/#author\"},\"datePublished\":\"2012-09-23T23:55:52+05:30\",\"dateModified\":\"2012-09-23T23:55:52+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Dynamically changing select value of jQuery Mobile select box | TO THE NEW Blog","description":"jQuery mobile gives you a very beautiful UI which is compatible with all popular mobile device platforms and i must say its very easy to learn as well. It gives you a very nice select menu instead of typical select box that we see on our web site, for this we just need to add","canonical_url":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/#article","name":"Dynamically changing select value of jQuery Mobile select box | TO THE NEW Blog","headline":"Dynamically changing select value of jQuery Mobile select box","author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/uday\/#author"},"publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"},"datePublished":"2012-09-23T23:55:52+05:30","dateModified":"2012-09-23T23:55:52+05:30","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/#webpage"},"isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/#webpage"},"articleSection":"Technology, jQuery Mobile, refresh jquery mobile select, select option value in jquery mobile"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.tothenew.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/www.tothenew.com\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/#listItem","name":"Dynamically changing select value of jQuery Mobile select box"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/#listItem","position":3,"name":"Dynamically changing select value of jQuery Mobile select box","previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/www.tothenew.com\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/www.tothenew.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.tothenew.com\/blog\/author\/uday\/#author","url":"https:\/\/www.tothenew.com\/blog\/author\/uday\/","name":"Uday Pratap Singh","image":{"@type":"ImageObject","@id":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/d4c98503-ff55-4112-8fc2-e3c4fcc6fc3a_282-Uday-Pratap-Singh-PROFILEPICTURE.jpeg","width":96,"height":96,"caption":"Uday Pratap Singh"}},{"@type":"WebPage","@id":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/#webpage","url":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/","name":"Dynamically changing select value of jQuery Mobile select box | TO THE NEW Blog","description":"jQuery mobile gives you a very beautiful UI which is compatible with all popular mobile device platforms and i must say its very easy to learn as well. It gives you a very nice select menu instead of typical select box that we see on our web site, for this we just need to add","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/#breadcrumblist"},"author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/uday\/#author"},"creator":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/uday\/#author"},"datePublished":"2012-09-23T23:55:52+05:30","dateModified":"2012-09-23T23:55:52+05:30"},{"@type":"WebSite","@id":"https:\/\/www.tothenew.com\/blog\/#website","url":"https:\/\/www.tothenew.com\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Dynamically changing select value of jQuery Mobile select box | TO THE NEW Blog","og:description":"jQuery mobile gives you a very beautiful UI which is compatible with all popular mobile device platforms and i must say its very easy to learn as well. It gives you a very nice select menu instead of typical select box that we see on our web site, for this we just need to add","og:url":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/","og:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Dynamically changing select value of jQuery Mobile select box | TO THE NEW Blog","twitter:description":"jQuery mobile gives you a very beautiful UI which is compatible with all popular mobile device platforms and i must say its very easy to learn as well. It gives you a very nice select menu instead of typical select box that we see on our web site, for this we just need to add","twitter:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"7993","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-29 14:32:11","updated":"2024-02-29 08:46:30","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tDynamically changing select value of jQuery Mobile select box\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.tothenew.com\/blog"},{"label":"Technology","link":"https:\/\/www.tothenew.com\/blog\/category\/technology\/"},{"label":"Dynamically changing select value of jQuery Mobile select box","link":"https:\/\/www.tothenew.com\/blog\/dynamically-changing-select-value-of-jquery-mobile-select-box\/"}],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/7993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=7993"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/7993\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=7993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=7993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=7993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}