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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:41:15+00:00 2026-06-10T05:41:15+00:00

I am trying to achieve an effect where the correctly entered text will result

  • 0

I am trying to achieve an effect where the correctly entered text will result in the image changing, letting the user know he typed it in correctly. The only problem I am having is if the person types the first two characters correctly, even if the third is incorrect it still stays changed.

Example: Take the word “ate” for instance.

If the user types in ” aate ” with two A’s the image still remains highlighted/changed.

Is it possible to make it somehow stay exact to what the correct text needs to be ?

JSFIDDLE here with google images for example:

http://jsfiddle.net/japaneselanguagefriend/wjx6b/

p.s. I hope I explained things cleary! I have been up and at this for hours and I could use a helping hand. Thanks so much 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-10T05:41:17+00:00Added an answer on June 10, 2026 at 5:41 am

    What you need is to check on the index

    $("#test").on('keyup', function() {
        var typed = this.value;
        $.each(text, function(index, item) {
            if (typed[index] == text[index]) {
                $('li', 'ul').eq(index).find('img').attr('src', happy[index]);
            }else{
                $('li', 'ul').eq(index).find('img').attr('src', grumpy[index]);
            }
        });
    });
    

    http://jsfiddle.net/wjx6b/2/

    Or exact match would need to compare the the current text with the array letters combined

    $("#test").on('keyup', function() {
        var typed = this.value;
        var theWord = ''
        for(i=0;i<typed.length;i++){
            theWord += text[i];
        }
        $.each(text, function(index, item) {            
            if (typed[index] == text[index] && typed == theWord) {
                $('li', 'ul').eq(index).find('img').attr('src', happy[index]);
            }else{
                $('li', 'ul').eq(index).find('img').attr('src', grumpy[index]);
            }
        });
    });
    

    http://jsfiddle.net/wjx6b/4/
    ​

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

Sidebar

Related Questions

I'm trying to achieve the effect of a pop-up when the user right-clicks in
Im trying to achieve the following effect in rails: If the text is bigger
I am trying to achieve a gradient + text shadow effect in Chrome/Safari using
I am trying to achieve an effect of overlapping the main window boundary with
I am trying to achieve this effect where a photo gets a repeating pattern
I am trying to achieve some effect using imageViews and I need to set
I'm trying to achieve an effect similar with youtube home page (you must be
I'm trying to achieve the effect of having a horizontal gradient stretch the entire
Trying to achieve any moving effect while appending an element from one to another
Is the above question possible? The effect I'm trying to achieve is similar to

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.