title: How to detect when the focus is out of a Div?
body: <p>I'am working on a dynamic form that generates a number of Divs. I would like to detect if the focus was lost from the entire div not just from one input. </p>
  
  <p><a href="https://i.stack.imgur.com/YopGs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YopGs.png" alt="enter image description here"></a></p>
  
  <p>As the picture shows , I have multiple identical forms , the issue here is how to detect if the user is done editing one of the forms? </p>
  
  <p>The forms are created dynamically using an ng-repeat. </p>
  
  <pre><code>&lt;fieldset  data-ng-repeat="response in responces" ng-init="sectionIndex = $index" &gt;
      &lt;div id="customFrom"&gt;
      &lt;input type="text" ng-model="response.code" name="" placeholder="Code"&gt;
      &lt;input type="text" ng-model="response.rank" name="" placeholder="{{ 'app.forms.responses.rank' | translate }}" &gt;
      &lt;input type="text" ng-model="response.value" name="" placeholder="{{ 'app.forms.responses.value' | translate }}"&gt;
      &lt;input type="text" ng-model="response.name" name="" placeholder="{{ 'app.forms.createQuiz.fields.name' | translate }}" class="labelTextQuestionCreation"&gt;
      &lt;button class="remove"  ng-click="removeResponse($index)" ng-show="deteteResponceOption"&gt;-&lt;/button&gt;
      &lt;/div&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>What is the best way to add an action when the users jumps from one form to another? I need to detect when a form (Div) lost the focus in order to execute a function. 
  Thank You. </p>