jQuery tutorial: run javascript function when user finishes typing

Hi guys! Today I will show you my method to detect when user finished typing in an input field. I have created a simple jQuery function which runs a javascript function when user finishes typing.

You must first create an input field with id search, and add this code then:

<script>
function run()
{
jQuery("p").html(jQuery("#search").val());
}
jQuery(document).ready(function()
{
jQuery("#search").keyup(function()
{
setTimeout(function(){run();}, 4000);
});
});
</script>

You can see how it works on my website: www.kashor.com

Video tutorial:









Leave a Comment