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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:52:35+00:00 2026-05-20T09:52:35+00:00

I have a setTimeout call: if ($cardOne instanceof jQuery){ setTimeout(function() { resetCard($cardOne); }, 1000);

  • 0

I have a setTimeout call:

if ($cardOne instanceof jQuery){

    setTimeout(function() {
        resetCard($cardOne);
    }, 1000);

    $cardOne = "";
}

calling this function:

function resetCard($card){
  $card.removeClass('show');
}

This results in this error:

Result of expression ‘$card.removeClass’ [undefined] is not a function.

And I am not sure what that means. Is setTimeOut wanting a return value of some sorts? I have verified that $card is, indeed, a jQuery object (in this case a DIV) .

UPDATE:

I added some more example code above to point out what I was doing wrong. Pointy got me to realize that the issue was that $card was not a jQuery object when the removeClass was being called on it.

If you look at my sample code, it’s now obvious in hindsight what I was doing wrong…I was calling the function inside a setTimeout and then immediately setting the $cardOne var back into an empty string. So, by the time setTimeout called the function, the var had been reset and no longer a jQuery object.

The fix is to move the setting of the object to an empty string into the resetCard function.

  • 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-20T09:52:35+00:00Added an answer on May 20, 2026 at 9:52 am

    What happens if you change “resetCard” as follows:

    function resetCard($card) {
      $($card).removeClass('show');
    }
    

    The error means that there’s no “removeClass” attribute on the object referenced by the “$card” parameter.

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

Sidebar

Related Questions

I have multiple setTimeout functions like this: function bigtomedium(visiblespan) { visiblespan.removeClass('big').addClass('medium'); setTimeout(function(){ mediumtosmall(visiblespan);},150); };
I have an ASP .NET page where I use jQuery. I used this function
I have this sniplet of code in jQuery $element.parent().children().last().hide().show('slide', {direction : 'left'}, 700, function
I want a jquery timer like setTimeout/setinterval to call a function repeatedly for every
I have an issue with a function call in setTimeout in a loop. The
I have a method that uses the setTimeout function and makes a call to
The Javascript timer event has this basic syntax: var t=setTimeout(javascript statement,milliseconds); I have this
I have a JQuery's .each loop that calls a function with a parameter per
I have a function called format() that I would like to call after ondrop
I want to call a function right after a scroll ends. I have tried

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.