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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:51:40+00:00 2026-05-24T23:51:40+00:00

There is data associated with certain items in a list for example below shows

  • 0

There is data associated with certain items in a list for example below shows data added to one item using jQuery, the first one:

$('ul li :first').data('job', 'Developer');
$('ul li :first').data('company', 'Microsoft');
$('ul li :first').data('location', 'UK');

Where job, data, location all have check-boxes the user can select from for example:

<label>
    Developer<input type="checkbox"/>
</label>
<label>
    Tester<input type="checkbox"/>
</label>
<label>
    Lead Developer<input type="checkbox"/>
</label>
<label>
    Google<input type="checkbox"/>
</label>
<label>
    Microsoft<input type="checkbox"/>
</label>
<label>
    UK<input type="checkbox"/>
</label>
<label>
    US<input type="checkbox"/>
</label>

Initially all the items in the list are shown. When a user selects a check-box all items in the list that do not have that attribute are hidden.

Does anyone know an approach I can take with this where there are multiple options in job, company and location?

  • 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-24T23:51:41+00:00Added an answer on May 24, 2026 at 11:51 pm

    If you look at jQuery data() documentation you will see that value can be any Javascript type including Array or Object.

    So you can do:

    $('ul li:first').data('job', ['Developer', 'Cleaner', 'Cook', 'Time waster']);
    

    or

    $('ul li:first').data([{
      job: "Developer",
      company: "Microsoft",
      location: "UK"
    },{
      job: "Manager",
      company: "Freelance",
      location: "Moon"
    }]);
    

    You can then add push members to array.

    $('#my_checkbox').check(function(){
        $('ul li:first').data("job").push($(this).value());
    });
    

    Or add elements to hash, or do whatever you want with data structure you choose.

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

Sidebar

Related Questions

I'm developing code using jQuery and need to store data associated with certain DOM
I think there is a wealth of natural language data associated with sites like
I have two processes one will query other for data.There will be huge amount
Is there a data type in eVC++ that is the equivalent of __int64 ?
Problem There are data gaps that need to be filled. Would like to avoid
A process to quickly detect whether there is data in a given worksheet or
I'm working on a project where there is data visualization. My ultimate goal is
In a MySQL (5.1) database table there is data that represents: how long a
I'm developping a xml data format. Besides other data there should be a xaml
When I dump a Sybase database, it doesn't seem to matter whether there's data

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.