- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Fire a JavaScript function when a user finishes typing instead of on key up?
To fire a JavaScript function when the user finishes typing, try to run the following code −
Example
<html> <body> <script> var timer = null; $("#myText").keydown(function(){ clearTimeout(timer); timer = setTimeout(doStuff, 1000) }); function doStuff() { alert("Write more!"); } </script> <input type = "text" id = "myText" /> </body> </html>
Advertisements