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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:59:53+00:00 2026-06-13T05:59:53+00:00

I am trying to make a simple quiz with just one question, I have

  • 0

I am trying to make a simple quiz with just one question,
I have got to the stage where if the correct answer is typed in then a “correct” message is shown, my problem is I also want to have an “incorrect” message display for 1 second then fade out if anything else is typed in the input field.

I dont really know how to get both functions to happen, here is what I have so far

http://jsfiddle.net/bloodygeese/3XGGn/36/

 <p>What is 10 x 2 ?</p>
<div id="correct">
That's Correct!
</div>
<div id="incorrect">
Sorry, Try again!
</div>
<input type='text' id="full_day"/>
<input type='button' id="buttontest" value="clickme"/>​



$(document).ready(function(){
$("#buttontest").click(function(){

    if ($('#full_day').val() == 20) {   

        $("#correct").show("fast"); //Slide Down Effect
    } 
    else {
        $("#correct").hide("fast");    //Slide Up Effect
    }
});


});​
  • 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-13T05:59:55+00:00Added an answer on June 13, 2026 at 5:59 am

    Make it simple with only one line to add. In your else:

    else {
         $("#incorrect").show("500").delay("1000").hide("500");
    }
    

    example: http://jsfiddle.net/3XGGn/39/

    EDIT:

    I see you already accepted the answer so it should be satisfactory, however, I noticed now that I misread your question.

    [..] “incorrect” message display for 1 second then fade out if anything else is typed in the input field.

    What I gave you fades away regardless of if anything is typed in the input field. I’ll provide you with the code for what you actually asked for and you can choose which one you want to use.

    $("#buttontest").click(function(){
    
        if ($('#full_day').val() == 20) {   
    
            $("#correct").show("fast"); //Slide Down Effect
        } 
        else {
            $("#correct").hide("fast");    //Slide Up Effect
            $("#incorrect").show("500");
        }
    });
    $("#full_day").change(function() {
        $("#incorrect").hide("500");
    });
    

    Example fiddle

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

Sidebar

Related Questions

Trying to make simple minesweeper game in python, but have one problem. I have
I'm trying to make simple many-to-one association, using NHibernate.. I have class Recruit with
I'm trying to make a simple three question quiz in php. After the user
Trying to make this simple applet - the first part just creates a simple
I am trying to make simple app that allows one to compare image to
im trying to make a simple game on cocos2d box2d, its basically got two
I am trying to make a simple AJAX calling in PHP and have a
i'm trying make simple app twitter and i use twitter4j library and i got
I am trying to make simple mysql select query, I have 3 tables post:
I trying to make a simple image gallery, where I have several radio button

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.