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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:44:43+00:00 2026-05-15T12:44:43+00:00

$("#input").keyup(function(){ console.log($(this).val()); }) When one is typing slowly "a" & "b" the above code

  • 0
$("#input").keyup(function(){
 console.log($(this).val());
})

When one is typing slowly "a" & "b" the above code will result in "a", "b" in the console log. But the problem is when somebody does it quickly. The result then is "ab", "ab". It’s easier to repeat this situation with letters which are near on a keyboard e.g. "e" & "r". How to avoid it?

Events keydown and keypress does not suffer from this problem of quick-typist, but they are also fire to early. Result: returned value of an input does not contain the last typed letter when they occur. Or maybe there is a way to get this last letter somehow?

  • 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-15T12:44:44+00:00Added an answer on May 15, 2026 at 12:44 pm

    Well, the problem is not really fast typing, but actually when the key up event happens. Consider this:

    • a is pressed
    • b is pressed
    • a is released
    • b is released

    No matter how slowly this is done, you will not get the key up event until the first key is released. There is obviously no way around this, you can’t cause the key up event before the key is released.

    If you just want the key that is pressed in a key press event, you can get it from the event object. Example:

    $('#input').keypress(function(e){
      console.log(e.which);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 530k
  • Answers 530k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer From what I can see, every time you resize the… May 16, 2026 at 11:37 pm
  • Editorial Team
    Editorial Team added an answer Countries.SelectedValue May 16, 2026 at 11:37 pm
  • Editorial Team
    Editorial Team added an answer string userchoice; do { userchoice=Console.ReadLine(); } while (userchoice=="y"); May 16, 2026 at 11:37 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have this code: inp = int(input("Enter a number:")) for i in inp: n
The input is string[] like below. "CSE111: CSE110 MATH101" "CSE110:" I need to order
It seems I can't make this example print "You submitted nothing!". Every time I
i want show 123 in my input tag value i write this: <INPUT TYPE=text
I am using MVC, not that this makes a difference, but I have a
I would like to have an input that would change to upper case on
I'm trying to read user input of integer. (like cin >> nInput; in C++)
I am trying to extract the content of a single "value" attribute in a
I am trying to make a JOptionPane get an input and assign it to
How to get the attribute name value of a input tag using jQuery. Please

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.