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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:32:22+00:00 2026-05-24T13:32:22+00:00

say i have these two uniquely ID’d divs with input elements that are not

  • 0

say i have these two uniquely ID’d divs with input elements that are not uniquely ID’d inputs.

<div id="column1" >
    ...
    <input checked="checked" type="checkbox" name="days" value="1" id="id_days_0" />
</div>

<div id="column2" >
    ...
    <input checked="checked" type="checkbox" name="days" value="1" id="id_days_0" />
</div>

how can i differentiate between the two inputs based on the top level div ID?

Obviously, this does not work:

$('#id_days_0').attr('checked')

Is there a way to only focus on one input’s ID from within a particular div?

  • 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-24T13:32:23+00:00Added an answer on May 24, 2026 at 1:32 pm

    As previously mentioned, you should always make your IDs unique and subsituting a class would be a good approach.

    With that being said, you may reference the necessary items as follows:

    HTML:

    <div id="column1" >
        First <input checked="checked" type="checkbox" name="days" value="Chk1" id="id_days_0" />
    </div>
    <div id="column2" >
        Second <input checked="checked" type="checkbox" name="days" value="Chk2" id="id_days_0" />
    </div>
    

    JavaScript:

    alert("Check1 = "+$("#column1 #id_days_0").val()+"\n"+"Check2 = "+$("#column2 #id_days_0").val());
    

    The reason that this can work, is due to the referencing of the objects based off of referencing the parent first, and then the child.

    Working example: http://jsfiddle.net/8VqtE/

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

Sidebar

Related Questions

Let's say I have these two strings: 5/15/1983 and 1983.05.15. Assume that all characters
Say you have these two methods: Number 1: void AddPerson(Person person) { // Validate
Say I have a database called Poll and have these two table structures. poll
Let's say we have these two classes: public class Base { public static int
Let's say I have these two arrays: string[] arr1 = new string[2]{Hello, Stack} string[]
We have two separate web-apps, say 'retailUI' and 'bulkUI'. These two are basically two
Say that I have two tables like those: Employers (id, name, .... , deptId).
Say I have two type classes defined as follows that are identical in function
Say you have table of some items with these two columns: ItemName Price ....where
Let's say I have a list somewhere called majorPowers which contain these two lists:

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.