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

  • Home
  • SEARCH
  • 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 9036853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:06:16+00:00 2026-06-16T09:06:16+00:00

Why doesn’t the following code work? var err = document.getElementById(text-error).value; if (err == Team

  • 0

Why doesn’t the following code work?

        var err = document.getElementById("text-error").value;
        if (err == "Team already exists") {
            $('#text-error').fadeIn(400).delay(3200).fadeOut(800);
        } 

The error does not fade in or fade out.

Checked the console – no problems.

Also, this particular error is sent via the server.

The fade in and fade out work for my client side errors – but not errors pertaining to my database like this one – if that makes any difference to the problem.


UPDATE

After console logging – I realize that it does not enter the if statement, even though it clearly equals it – via html code and via a quick glance at the page.

  • 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-16T09:06:17+00:00Added an answer on June 16, 2026 at 9:06 am

    I am assuming you have something like

    <div id="text-error> Team already exists </div>
    

    If so, then replace your first line of code with

    var err = document.getElementById("text-error").innerText;
    

    JsFiddle – http://jsfiddle.net/fCNe8/

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

Sidebar

Related Questions

Why doesn't this code work? b if b = true Error: undefined local variable
Why doesn't the following code throw a java.net.BindException: Address already in use: JVM_Bind exception?
id doesn't want to put the value in to the document.getElementById(UniLoc).value = val; and
Why doesn't this work in VS 2010 typename std::enable_if<!std::has_trivial_destructor<Titem>::value, BOOL>::type Clear() { ... }
This doesn't compile and gives the following error: Illegal start of expression . Why?
Doesn't oEvent.preventDefault(); work in GC? I need to prevent selecting text when the onmove
Why doesn't the following work? It appears that the literal zero at the end
Why doesn't client validation work? <script src=<%: Url.Content(~/Scripts/jquery-1.4.1.min.js)%> type=text/javascript></script> <script src=<%: Url.Content(~/Scripts/MicrosoftAjax.js)%> type=text/javascript></script> <script
Doesn't work: var b:ByteArray = new ByteArray(); b.writeFloat(-50.000000); b.position = 0; cpp.processFloat(b,b.bytesAvailable); CPP: static
Doesn't work with other modules, but to give an example. I installed Text::CSV_XS 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.