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 7697023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:54:56+00:00 2026-05-31T21:54:56+00:00

History: I’m using the children method because I’ll be looping through div s that

  • 0

History:

I’m using the children method because I’ll be looping through divs that have content in them that is dynamically generated by the user, so there’s no way of me knowing how many divs there will be. If there is another method I should be using, by all means, show me 🙂

I’m having trouble here using the following code:

$("[name = listItem]").each( function (){
var z = $(this).children("[name='dropDown'] option:selected").val();
alert(z);
});

In this example the output would be an alert box with:

undefined

It’s strange because this way bellow works fine!

var z = $("[name='dropDown'] option:selected").val();
alert(z);

the output for this would be the appropriate value:

1

for the children() method, I thought you could use the standard selector syntax. What do you think?

  • 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-31T21:54:57+00:00Added an answer on May 31, 2026 at 9:54 pm

    Try:

    $("[name = listItem]").each( function (){
        var z = $(this).find("option:selected").val();
        alert(z);
    });
    

    Or:

    $("[name='dropDown'] option:selected").each( function (){
        var z = $(this).val();
        alert(z);
    });
    

    But i am a bit confused as to what listItem & dropDown are…

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

Sidebar

Related Questions

I have a History Table in SQL Server that basically tracks an item through
I've seen that history.go() method can have two types of parameter: see: http://www.w3schools.com/jsref/met_his_go.asp But
We have a history table that stores xml web service requests and responses. Currently
href=# onclick=closeOrCancel() and history.go(-1) in that js method doesnt work in Chrome (neither history.back()
brief history. I have a little reporting tool that I am creating that uses
I'm using jquery.history lugin found here: http://tkyk.github.com/jquery-history-plugin/ With this i load content into a
I'm using jquery.history plugin in my web-app and have a problem with '/' being
- Bref history: - I was using MapServer, everything was working fine except that
I have a table that records a history of address updates, called transaction. The
History: I read from one of Knuth's algorithm book that first computers used the

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.