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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:35:30+00:00 2026-06-04T05:35:30+00:00

I’m having problems making this code work: $(function(){ $(‘div.tags’).delegate(‘input:checkbox’, ‘change’, function() { var $lis

  • 0

I’m having problems making this code work:

    $(function(){
        $('div.tags').delegate('input:checkbox', 'change', function() {
            var $lis = $('.results > li').hide();
            //For each one checked
            $('input:checked').each(function() {
                    $lis.filter('.' + $(this).attr('rel')).show();
            });
        });
    });

With HTML like:

      <div class="tags">
        <label><input type="checkbox" rel="arts" /> Arts </label>
        <label><input type="checkbox" rel="computers" /> Computers </label>
        <label><input type="checkbox" rel="health" /> Health </label>
        <label><input type="checkbox" rel="video-games" /> Video Games </label>
      </div>
      <ul class="results">
         <li class="arts computers">Result 1</li>
         <li class="video-games">Result 2</li>
         <li class="computers health video-games">Result 3</li>
         <li class="arts video-games">Result 4</li>
      </ul>

I’ve tried it in IE, FF & Opera, but I don’t get expected results. That is, the content is not being filtered upon clicking a checkbox? I’m trying to replicate something similar to this:

http://www.houseoffraser.co.uk/Jeans+for+Women/302,default,sc.html

Notice the accordian effect on the left side bar of the page. I’m not too worried about the accordian itself, it’s the checkboxes function that I’m focusing on at the moment. On page load, all query results (some 1300 or so), are displayed to the user.

A user can then filter or refine the results by clicking on checkboxes. I’m assuming this is some kind of Jquery/Ajax script, but am not entirely sure? Am I on the right track?

Thanks in advance.

  • 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-04T05:35:31+00:00Added an answer on June 4, 2026 at 5:35 am

    You mentioned in a comment that you’re using jQuery 1.3

    jQuery’s delegate() method was introduced in 1.4.2, so won’t be available. You’ll have to use a later version of jQuery (any reason why you’re using such an old version?).

    If you open your developer console (F12 shortcut in Chrome), you should see an error saying that TypeError: Object [object Object] has no method 'delegate'

    If you need to use jQuery 1.3, try:

    $(function() {
        $('div.tags').bind('change', function(e) {
            var that = e.originalEvent.target;
    
            if ($(that).is('input:checkbox')) {
                var $lis = $('.results > li ').hide();
                //For each one checked
                $('input:checked ').each(function() {
                    $lis.filter('.' + $(that).attr('rel')).show();
                });
            }
        });
    });
    

    Which you can see working here
    ​

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
We're building an app, our first using Rails 3, and we're having to build
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

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.