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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:52:39+00:00 2026-06-08T08:52:39+00:00

I have these input objects as follows, <input type=’radio’ class=but option value=’Yesterday’> <input type=’radio’

  • 0

I have these input objects as follows,

 <input type='radio' class="but option" value='Yesterday'>
<input type='radio' class="but option" value='Last Week'>  
<input type='radio' class="but option" value='Last Month'>
<input type='radio' class="but option" value='All Time'>

and I have a jquery click event handler that says $(".but").click(function() {

These input objects are getting caught in this event handler and I’m wondering why when their class names are not “but”

  • 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-08T08:52:41+00:00Added an answer on June 8, 2026 at 8:52 am

    If you have spaces in a class attribute then you’re assigning multiple classes, not one with a space in its name. So your inputs have two classes: “but” and “option”.

    When you’re matching on class names (e.g. with jQuery) then it will match any element that has that class, even if the element has other classes as well. That’s why all your inputs (that all have a class “but” as well as another class) are matched.

    You can read more about this for example in the relevant html4 and html5 documents at W3, or over at the MDN.

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

Sidebar

Related Questions

I have these text inputs in a table : <td><input type='text' name='arrondi_devis_ht' class='calcul_total' size='8'></td>
Hi all I have a view with these controls on it <input type=text class=radius2
I have a form that uses jquery to generate rows of input fields these
I have a dijit.form.NumberTextBox input field that starts out with these parms: new dijit.form.NumberTextBox({
I have a form 'ChallengeType'. Which has these fields: 1) Embedded form team1 input
I am wanting to check if input fields have the attribute required. If these
I have a form with some generated input fields like theese: <input value=March name=month[March]
I have a custom class declared as follows (in vb.net) <Serializable()> Public Class NumInfo
I have a JAXB generated class, with a collection with the abstract type COBJECT.
In several places I have to retrieve some value from a dict, but need

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.