Set selected option jquery by index
Someone is sending a form via GET to my result page.
Set HTML Select Options Selected value Using jQuery
When the result page is submitted, the URL looks like this for example. Now, theres a select with the id filtercountry and it contains all the countrys available to filter. When the GET value Reiseziel is set, i want to iterate trough the values of the select and make the right option selected.
The URL contains "index. How would i achieve this? Selecting option by text content with jQuery. Use this function described here:.
You will get country name in Reisezielnew and you can use it as u want. By posting your answer, you agree to the privacy policy and terms of service.
Stack Overflow Questions Developer Jobs Documentation beta Tags Users. Sign up or log in to customize your list.
Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us. Log In Sign Up.
Join the Stack Overflow Community. Stack Overflow is a community of 7. Join them; it only takes a minute: When the result page is submitted, the URL looks like this for example index.
jQuery - set select index by elements id - Stack Overflow
Selecting option by text content with jQuery I belive this does exactly what you're asking. Jochen van Wylick 3, 3 25 Use this function described here: Use this function to fetch the value from query string, it uses RegExp: Raman 6 Somnath Kharat 2, 2 16 P 5 Sign up or log in StackExchange.
jQuery - set select index by elements id - Stack Overflow
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Stack Overflow works best with JavaScript enabled.
MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3. Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.