onfocusout event in Jquery

This event triggers when you focus on an element and then click anywhere else outside of that element. This works for input fields or any other element that has a contenteditable:true attribute.


<!DOCTYPE html>
  <title>Jquery on focusout event</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<h1 contenteditable="true" align="center">Click me and then click anywhere else.</h1>


Leave a Comment