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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:36:29+00:00 2026-06-06T05:36:29+00:00

I have an input on an HTML page where a person will type something

  • 0

I have an input on an HTML page where a person will type something and what I’m wanting is for a function to be called every time they stop typing. I know about the onkeypress event, but that is called every time a character is typed. Here’s an example of what I would like:

  1. Person types “this is a test” into the input
  2. After the person stops typing, function foo() should be called
  3. Person types something else into the input
  4. After the person stops typing, function foo() should be called
  5. Repeat….

Is this possible?

Thanks a lot!

  • 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-06T05:36:30+00:00Added an answer on June 6, 2026 at 5:36 am

    Listen to onkeyupevent. There start a timeout (you have to define “stop” as some time amount, otherwise it will be called at every keyup), and in the timeout execute your function.

    If onkeydown is called while your timer is running, stop it.

    Something like…

    var timer;
    
    function onKeyUpHandler(e){
        timer = setTimeout("foo()", 500)    
    }
    
    function onKeyDownHandler(e) {
        clearTimeout(timer);
    }
    

    How this code exactly looks depends where and how you are using it… just to show the way to do it.

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

Sidebar

Related Questions

I have the following HTML on my web page: <input id=htmlEdit type=checkbox/> Once the
I have a button in my abc.html page <input type=button onclick=javafun();> on the click
We have 5 inputs ( type=text ) on html page /edit_person.php : <input id=name
I have a HTML page with the following input tag: ... <input type=file id=browseContactImageButton
I have an input in an HTML page <input id=SearchBox type=text value= width=300px title=Search
I have a JS script that appends to the HTML page the pairs: input
I have a page with File html input field and a Submit button as
I have html similar to this <input class=rowinput type=text id=text_input_1 size=1 value=3> <input class=rowinput
I have added some javascript in html page for input validation.same page is working
I have a form in my HTML page, containing a label, an input field

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.