jQuery > Events

Focus out event in jQuery

How to attach focus out event to an html element in jQuery?


To attach focus out event to a html element, focusout() method can be used.

<script>
      $("#txtFocusOut, #txtFocusOut1").focusout(function () {
          alert("got focus out");
      });
  </script>

In the above code when user leave the focus (keep the cursor away) from “txtFocusOut” and “txtFocusOut1” textboxes then user will be alerted with message "got focus out" (we have used multiple selector here to select multiple element).

 Views: 6386 | Post Order: 71



Write for us






Hosting Recommendations