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

  • Home
  • SEARCH
  • 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 6223419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:29:14+00:00 2026-05-24T08:29:14+00:00

I have this not so many checkboxes: <input type=checkbox id=mango value=mango /> <label>MANGO</label><br> <input

  • 0

I have this not so many checkboxes:

<input type="checkbox" id="mango" value="mango" /> <label>MANGO</label><br>
<input type="checkbox" id="santol" value="santol" /> <label>SANTOL</label><br>
<input type="checkbox" id="guava" value="guava" /> <label>GUAVA</label><br>
<input type="checkbox" id="lomboy" value="lomboy" /> <label>LOMBOY</label><br>
<input type="checkbox" id="apple" value="apple" /> <label>APPLE</label><br>
<input type="checkbox" id="orange" value="orange" /> <label>ORANGE</label><br>
 ...................<>

Now, what I’m trying to do is get all the ID’s of check boxes with check, and no check and put in an array. Something like this:

"fruitsGranted":["apple","lomboy","orange"]; //check is true
"fruitsDenied":["mango","santol","guava"];  //check false

can please someone show me how to do it.? thanks.

  • 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-24T08:29:15+00:00Added an answer on May 24, 2026 at 8:29 am
    var someObj={};
    someObj.fruitsGranted=[];
    someObj.fruitsDenied=[];
    
    $("input:checkbox").each(function(){
        var $this = $(this);
    
        if($this.is(":checked")){
            someObj.fruitsGranted.push($this.attr("id"));
        }else{
            someObj.fruitsDenied.push($this.attr("id"));
        }
    });
    

    http://jsfiddle.net/UqrYJ/

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

Sidebar

Related Questions

I have some checkboxes like this: <input type=checkbox name=regions[] value=north-east />North East<br /> <input
I have something like this on my view: <input type=checkbox value=1 name=services-for /> <input
Consider this simple example code: <form name=text id=frm1 method=post> <input type=checkbox name=name[] value=1000> Chk1<br>
Im trying to grab value from label checkbox:checked. I have created this function var
Not many are aware of this feature, but Python's functions (and methods) can have
I have searched through many times but have not seen this before. Probably really
I have this code I am checking wheather checkbox i checked or not.. $('#btnsubmit').click(function()
I have many checkboxes in a dynamically produced (ASP) photo gallery. Each checkbox has
This is probably not possible, but I have this class: public class Metadata<DataType> where
I have this div: <div class=inauguration-image> I do not want this text to display,

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.