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

  • SEARCH
  • Home
  • 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 6784315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:58:32+00:00 2026-05-26T16:58:32+00:00

I have a scenario where I want to parse through all the values displayed

  • 0

I have a scenario where I want to parse through all the values displayed on screen for a radio button.

Now the radio button can be any one of the following, in coding style–

<input type="radio" name="lunch" value="pasta1" /><span>Pasta</span>

OR

<input type="radio" name="lunch" value="pasta1" /><p>Pasta</p>

OR

<input type="radio" name="lunch" value="pasta1" /><ul>Pasta</ul>

OR <input type="radio" name="lunch" value="pasta1" />Pasta

Basically I have to deal with any type of real world HTML… While I can get the factual value (=”pasta1″ for this example) using val(), I want to obtain the text “Pasta” also as shown above, irrespective of whatever tags may be used, in any combination… Is it possible to get such data? At the very least, is it possible to get (for our examples above) the element pointing to <p>Pasta</p> or <ul>Pasta</ul> and so on? Then I can try and extract the exact text from that element/node…I can use pure javascript or jquery…

  • 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-26T16:58:33+00:00Added an answer on May 26, 2026 at 4:58 pm

    if you use this:

    $(this).next()
    

    It will give you the very next element to the one you called in your function.

    If you find out what control is selected(picked radio button) you just have to get the next controls value.

    $(this).next().val()
    

    This way it wont depend on what type you use to put your value in 🙂
    Still I would suggest you would use labels.
    Those are easier to align with your radio button 😉

    Hope this helped.

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

Sidebar

Related Questions

I have a scenario where I want to call one TFS build from another,
We have a scenario where we want to display a list of items and
I have the following scenario where I want to pass in string and a
I have the following scenario, I want to create a DataGrid and then populate
The Scenario I have an ASP.NET web project. I want to be able to
Scenario I have a windows forms application. I want to use two different WCF
Here's the scenario: I have a set of buttons that I want to bind
So here is the scenario: I have a MOSS 2007 box and I want
I have a deceptively simple scenario, and I want a simple solution, but it's
I want to accomplish the following scenario in Drupal: You have 2 content-types. Lets

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.