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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:09:42+00:00 2026-05-18T10:09:42+00:00

As a newbie, I’m trying to pull something off and have gotten stuck. I’m

  • 0

As a newbie, I’m trying to pull something off and have gotten stuck. I’m attempting to select a table row with an id of “fc_cart_foot_tax_tbd” and add a class of “selected” if someone enters a state other than Illinois into an input field with the class of “customer_state_name”. Here’s my HTML that doesn’t work.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Basic</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" charset="utf-8">
    $(document).ready(function(){
    //Show the tax info if the shipping state is not Illinois
        $("#customer_state_name").each(function()
        {
            if (!$(this).html() == 'Illinois')
            {
            $("#fc_cart_foot_tax_tbd").addClass("selected");
            }
        });
    });
    </script>
    </head>
    <body>

    <form action="#">
    <input name="state" id="customer_state_name" value="" />
    </form>

    <table>
    <tr id="fc_cart_foot_tax_tbd">
    <td>Content here!</td>
    </tr>
    </table>

    </body>
    </html>
  • 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-18T10:09:42+00:00Added an answer on May 18, 2026 at 10:09 am

    Right a few concerns.

    1. You are using a .each() function on an ID. IDs must be unique within a document, use a class if there are multiple items.
    2. You are using $(this).html() to get the value of an <input> field, use .val() instead.
    3. The code you have only executes once on entry to the page, you need to make a .change() function on the <input>s, so that it runs every time the users alters them.
    4. You are using (!a == b) as your condition, this is not what you intend I think, you should use not-equal (a != b).

    jQuery:

    $(document).ready(function() {
      $(".customer_state_name").change(function() {
        if ($(this).val() != 'Illinois') {
          $("#fc_cart_foot_tax_tbd").addClass("fc_cart_foot_tax_tbd");
        } else {
          $("#fc_cart_foot_tax_tbd").removeClass("fc_cart_foot_tax_tbd");
        }
      });
    });
    

    HTML:

    <form action="#">
        <input name="state" class="customer_state_name" value="" />
    </form>
    
    <table>
        <tr id="fc_cart_foot_tax_tbd">
            <td>Content here!</td>
        </tr>
    </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Newbie to LINQ, and trying to write the following query... select f.Section_ID, f.Page_ID, f.SortOrder,
Newbie question. I have a NSMutableArray that holds multiple objects (objects that stores Bezier
Java Newbie here. I have a JFrame that I added to my netbeans project,
Total newbie question but this is driving me mad! I'm trying this: myInt =
I'm a newbie to pgsql. I have few questionss on it: 1) I know
Newbie here...can I write one program which incorporates .NET LINQ and also various Java
.NET newbie here... I'd like to make a button in a Windows form that
Sorry for the second newbie question, I'm a developer not a sysadmin so this
I'm a Drupal newbie. Is it possible to set up everything and deploy Drupal
I'm a newbie when it comes to SQL. When creating a stored procedure with

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.