Skip to content
Advertisement

Detect when user first types and last types and not in between

I have a case where I want a function to fire only when I first type something and fires another function when the I’m done typing (10 seconds idle)

I have this:

JavaScript

But the issue with this is it triggers the updateLastTypedTime() everytime i type.

Thanks!

Advertisement

Answer

It looks like you want another function that’s called from updateLastTypedTime only if the user was not already typing, something like:

JavaScript

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement