Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7090739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:05:35+00:00 2026-05-28T08:05:35+00:00

Using jQuery 1.6.2 HTML that I’m operating on <select id=langId> <option value=0>Argentina – Spanish</option>

  • 0

Using jQuery 1.6.2

HTML that I’m operating on

<select id="langId">
    <option value="0">Argentina - Spanish</option>
    <option value="1">Brazil - Brazil English</option>
</select>

I need to get the string of the selected value (ie: “Brazil – Brazil English”)

What I am currently using:

var langVal = $('#langId option[value="' + $('#langId').val() + '"]').contents();

This works to a point. It gives me something like ["Brazil - Brazil English"] which I can access at langVal[0]

If I do console.log(langVal[0]) then I get what I am looking for "Brazil - Brazil English", but if I do something like console.log(("The value is: " + langVal[0])); then what I see is The value is: [object Text]

I have no idea what is causing this [object Text] to show up instead of my value. I’ve tried the toString() method, but it doesn’t help.

The end goal is to get the text value of the selected object into a cookie. The numerical value attribute on the option elements must remain the same.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:05:36+00:00Added an answer on May 28, 2026 at 8:05 am
    $("#langId option:selected").text()
    

    That will get you the text of the currently selected option in your select list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jquery validation plugin. I have an html that looks like: <h2>Select
How to remove using jquery html table row after checking checkbox that in this
I have a blob of HTML that I'm retrieving using simple jQuery selectors, something
I'm calling a webmethod using jquery, the webmethod returns a chunk of HTML that's
Using jQuery's qtip plugin, I'm trying to display hidden value (that's already rendered wher
I am trying to create a button using HTML/jQuery that is positioned on the
I have some text content (read in from the HTML using jQuery) that looks
How do I get the HTML that makes up an element using Jquery or
Using jQuery, I'd like to remove the whitespace and line breaks between HTML tags.
I'm using jQuery to change the HTML of a tag, and the new HTML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.