title: Jquery - Only trigger blur event within a specific class
body: <p>How can I set a limitation to an on blur trigger event. What I'm trying to do is call a function on blur of textarea, but the function shouldn't  be called if I click outside of the specified container.</p>
  
  <p><strong>Edit</strong>: It seems like there's no way to cancel the trigger event. In this case, how can I modify the function instead, so it will only return certain value on click within a specified container.</p>
  
  <p>Code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('textarea').on('blur', function() {
    TestFunction();
  });
  
  
  function TestFunction() {
    // if clicked on container
    console.log('called')
    // else return
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.container {
    height: 80px;
    width: 100%;
    background: green
  }
  
  .outside {
    height: 80px;
    width: 100%;
    background: blue
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;div class="container"&gt;
    Container
    &lt;textarea&gt;123&lt;/textarea&gt;
  &lt;/div&gt;
  
  
  &lt;div class="outside"&gt;
   Outside
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>