Namespace function in jQuery
<p>What is the difference between these two pieces of code? Both are working perfectly, so why use .dropdown.data-api in a function? I read about namespace on the internet, but I am not clear about that. Can anyone tell me what is the use of namespace functions?</p>

<pre><code>$('html').on('click.dropdown.data-api',
  function () {
    $el.parent().removeClass('open')
  })
}

$('html').on('click',
  function () {
    $el.parent().removeClass('open')
  })
}
</code></pre>
