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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:16:29+00:00 2026-06-05T07:16:29+00:00

Here is a basic example of what I am trying to achieve : <select

  • 0

Here is a basic example of what I am trying to achieve :

<select name="userId" id="userId">
<option value="1">Charles</option>
<option value="2">Mike</option>
<option value="3">Jeff</option>
<option value="4">Kevin</option>
</select>

<select name="userId" id="userId">
<option value="1">Charles</option>
<option value="2">Mike</option>
<option value="3">Jeff</option>
<option value="4">Kevin</option>
</select>

<select name="userId" id="userId">
<option value="1">Charles</option>
<option value="2">Mike</option>
<option value="3">Jeff</option>
<option value="4">Kevin</option>
</select>

For instance, I would like to select the third option (Jeff) of the second “userId” dropdown. I know how to do that for a unique dropdown, but I can’t get it to work with multiple dropdowns having the same ID.

I thought I would be able to do it with the following line:

$("input[id=userId]").eq(1).val("3");

.. but it doesn’t work.

Any idea?

Thank you very much

Charles

  • 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-06-05T07:16:31+00:00Added an answer on June 5, 2026 at 7:16 am

    You can’t. A DOM element’s id is supposed to be globally unique. Having the same id="userId" bit 3 times is broken HTML. Instead, use:

    <select name="userId" class="userId">
    ...
    </select>
    

    Then you can do:

    $('select.userId').<whatever jquery you want>;
    

    and you’ll be all set.

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

Sidebar

Related Questions

We have a Union Query. Here's a basic (similar) example: SELECT a.Name, b.Info FROM
I'm trying to follow the basic cometd example here: http://dojotoolkit.org/reference-guide/1.7/dojox/cometd.html It's using the old
I'm trying to implement this basic example found here : under the section titled
here's a basic example of what I'm trying to do: <div class=container> <h2>Greetings</h2> <p>All
I'm trying to implement the Basic example for the GwtUpload library, as found here
I am trying to run the basic fb connect example provided here http://developers.facebook.com/docs/guides/web#login Everything
I'm trying to comprehend ontology basics. Here's an example: car (class) 2009 VW CC
To provide as much information as I can, here's a very basic example of
Here is an example of what I would do in Visual Basic: Public Class
Here is my basic situation. I'm trying to use NHibernate to get information from

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.