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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:19:46+00:00 2026-06-04T19:19:46+00:00

Edit: Ok just to get this straight, you use the not selector to filter

  • 0

Edit: Ok just to get this straight, you use the not selector to filter attributes in a particular tag and not to filter child elements?

Can someone help me out whether I have some sort of syntax error here, or may be I’m not understanding the concept?

I have list items which when you click on, they change the font size of the body. Now the list item is within the body so its font changes to. I would like this UL to remain with the same font. so I am using the .not(“#ulSize”) as can be seen below. But this is not working.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#liSmall").click(function () {
                $('body').not('#ulSize').removeClass('large normal').addClass('small');
            });
            $("#liNormal").click(function () {
                $('body').not('#ulSize').removeClass('large small').addClass('normal');
            });
            $("#liLarge").click(function () {
                $('body').not('#ulSize').removeClass('small normal').addClass('large');
            });
        });
    </script>
    <style type="text/css">
        .large
        {
            font-size: large;
        }

        .normal
        {
            font-size: medium;
        }

        .small
        {
            font-size: small;
        }
    </style>
</head>
<body>
    <ul id="ulSize">
        <li id="liSmall">Small Font</li>
        <li id="liNormal">Normal Font</li>
        <li id="liLarge">Large Font</li>
    </ul>
        Text in here!!!
</body>
</html>

Thank you guys

  • 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-04T19:19:48+00:00Added an answer on June 4, 2026 at 7:19 pm

    I’d recommend refactoring your JS to something like this:

    $(function(){
      $('#liSmall, #liNormal, #liLarge').on('click', function(e){
        $('body').removeClass('small medium large');
        switch(this.id){
          case 'liSmall': $('body').addClass('small'); break;
          case 'liMedium': $('body').addClass('medium'); break;
          case 'liLarge': $('body').addClass('large'); break;
        }
      });
    });
    

    And then hard-code a font-size on the #ulSize list, and let the browser do the rest.

    #ulSize {
        font-size: 16px !important;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

** EDIT ** Nevermind, just needed to take out the parens... I get this
EDIT This is homework so no straight up code please. Just hints, thank you!
Just to get it straight in my head. Consider this example bit of Erlang
I can't quite get my head around this particular problem, and I'm hoping you
EDIT: Just to make things clear, this problem was caused by a typo in
When I try to use java.lang.System.console(), I get a null pointer. I can still
Fedora Core 9 includes Python 2.5.1. I can use YUM to get latest and
I need some help with my xpath query. I can get this code to
This pattern comes up a lot but I can't find a straight answer. An
Edit: just to be clearer on what I am looking to do. I have

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.