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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:31:28+00:00 2026-06-13T14:31:28+00:00

See this fiddle for code I have two select controls on a page, I

  • 0

See this fiddle for code

I have two select controls on a page, I want to select one of them using a combination of the id and the control type.

If I use the ID and control type, jquery returns a length of 0.

 $('#bothCount').text($('#Title select').length);

NB: On some other page, I have an input with id Title, thats why I want to filter down to select controls only.

  • 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-13T14:31:29+00:00Added an answer on June 13, 2026 at 2:31 pm

    The selector

    #Title select
    

    …is a descendant selector. It looks for any select that’s a descendant of the element with the id Title.

    If you really want to combine tag and id, you do it like this:

    select#Title
    

    E.g.:

    $('#bothCount').text($('select#Title').length);
    

    Note that there’s usually little point in doing that, though, because id values have to be unique on a page. The only use case I know of for it is if you don’t know what tag the element is going to have and you only want to act on it if it has a particular tag type, which is definitely an edge case.

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

Sidebar

Related Questions

Please see this fiddle I want the scrolling div stop following when left div
I have made JavaScript code using the fiddle.com website. But in fiddle I can
Please see this fiddle , where I have a button and three input boxes
I have some simple code you can see in my fiddle . It alerts
I have some code to randomly highlight one name from a list (this works
See this fiddle for an example of what I mean or view this code.
In this fiddle you see a table with a select-field where you should select
see this fiddle . This upon running gives an error in console. I'm currently
See this code: TicketStoreService fakeTicketStoreService = MockRepository.GenerateMock<TicketStoreService>(); fakeTicketStoreService.Expect(service => service.DoSomething(Arg.Is(new Guid())) .Return(new Guid()); fakeTicketStoreService.DoSomething(Arg.Is(new
see this demo from jquery ui you have to hold down the Ctrl key

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.