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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:23:53+00:00 2026-05-23T01:23:53+00:00

Say I have a jquery function within JavaScript and I have this code so

  • 0

Say I have a jquery function within JavaScript and I have this code so far, which works great:

jQuery('div[class="someClass"] input[type="text"]').each( function() { //some code} . . .

In the above code, how can I target multiple types of inputs such as textArea, drop-down list etc. I am pretty new to jQuery so I am not aware of the format a google search did not bring up anything of much relevance! Please help.

  • 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-23T01:23:54+00:00Added an answer on May 23, 2026 at 1:23 am

    If you’re happy to select all descendent elements that are of these types:

    • input
    • textarea
    • select
    • button

    you can use the :input selector.

    jQuery('div.someClass :input').each(function() {...
    

    Otherwise, you can do this in a big selector using the multiple selector as Niklas suggests. One last option is to shorten this by using two selections. This may be slightly slower, but will be significantly more readable:

    jQuery('div.someClass').find('input[type="text"], select, textarea').each(function(){...
    

    Note that I have used the class selector to make your selector a bit neater.

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

Sidebar

Related Questions

Say I have jquery code like this: html += '<div class=index>' + item.index +
Say I have 4 div elements with class .navlink , which, when clicked, use
I think this should be simple. Say I've got the following jQuery: $someForm.live('submit', function(event)
Let's say I have the following jQuery AJAX call: $.ajax({ type: POST, url: MyUrl,
Say I have a class named Frog, it looks like: public class Frog {
I have the following jQuery code. As you can see, I have an alert
Let's say I have the following scenario: <form action=/something.php method=GET>Click me</div> <script type=text/javascript><!-- $('form').submit(function(e)
Say I have info.php page with user info (id, name, age, etc). On this
I would like to have a function that returns the repsonseText of a jQuery.ajax()
Let's say we have like 3 functions: // Notice there are no $(document).ready function

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.