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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:17:19+00:00 2026-06-15T09:17:19+00:00

<select id=select1> <option value=11>11</option> <option value=12>12</option> </select> <select id=select2> <option value=21>21</option> <option value=22>22</option> </select>​

  • 0
<select id="select1">
    <option value="11">11</option>
    <option value="12">12</option>
</select>

<select id="select2">
    <option value="21">21</option>
    <option value="22">22</option>
</select>​

Behavior of the find() and the children() methods:

find():

$('#select1, #select2').find('option:not(:first)').remove();​​​​​​

Works as expected: select1 has only option 11 and select2 has only option 21

children():

$('#select1, #select2').children('option:not(:first)').remove();

Works weirdly: select1 has only option 11 but select2 has no option anymore…

Why?

Demo

  • 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-15T09:17:19+00:00Added an answer on June 15, 2026 at 9:17 am

    From what I see

    $('#select1, #select2').find('option:not(:first)')
    

    is equal to

    $('#select1  option:not(:first), #select2  option:not(:first)')
    

    not

    $('#select1, #select2').children('option:not(:first)')
    

    Think about the context selector as it’s the same as using .find()

    $('option:not(:first)',$('#select1, #select2'))
    

    By using children with first.. you are only getting the first children option returned in collection.. whereas the context/find selector looks for the first in each context

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

Sidebar

Related Questions

I'm trying to select the option based on the php variable value. So I
When I select any option in list then it should print its value in
<Select id=amount onchange=document.formName.submit(); updateCost();> <option id=0 value = 0> Select amount ... </option> <option
<Select> <option value=1>One</option> <option value=2>Two</option> <option value=3>Three</option> </Select> I am using document.getElementById(Example).value; to get
Following dropdown: <select id='dropdown' name='dropdown' onchange='showChart(this.value)'> <option value=1>Foo</value> <option value=2>Bar</value> </select> Calls this javascript
I have the following drop down list: <select name=selSS1 id=select_value> <option value=val0>sea zero</option> <option
I have a simple dropdown menu: <form class=feedmenu align=center> <select onchange=showRSS1(this.value)> <option value=>Select an
I have a list like this: <select name=select_list_name id=list_id> <option value=>Select Option</option> <option value=value1>Option
I have some code that first selects an option value in a dropdown menu
Scenario: I got 2 jQuery expressions: /* A */ $('select').find('option[selected]'); /* B */ $('select').find('option').filter('[selected]');

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.