jQuery focusout() Method

jQuery focusout() method trigger the focusout event. The jQuery focusout event occurs when an element (or any elements inside it) loses focus. And when the focusout event occurs, specified function will execute.

jQuery blur() method trigger on the selected element. Where as jQuery focusout() method trigger on the selected element including any child elements inside it.


This triggers the focusout event for selected elements or any child elements inside it.

$(selector).focusout();        // This syntax does not accept any arguments.

This attach a function to the focusout event.

Parameter Type Description
function Function Optional. Specifies the function to execute when the focusout event is occurs.


This example represents the focusout() event.

<!DOCTYPE html>
  <title>jQuery focusin() and focusout() method</title>
  <script src="jquery-latest.min.js"></script>
        $(this).css("background-color", "yellow");
        $(this).css("background-color", "white");
  <p>Click on following text field to occur focusin or focusout events.</p> 
  <div style="padding:15px 10px;">
    Name: <input type="text" name="name" />
  <div style="padding:15px 10px;">
    E-mail: <input type="text" name="email" />
  <div style="padding:15px 10px;">
    Phone: <input type="text" name="phone" />

Run it...   »