I have a situation where when I click on milestones link it unhide a dropdown div with milestones as a heading.
My requirement is when I click inside that div anywhere it should not get hide. it should get hide when I click outside that div only. Current problem is when I click inside that div it get hide. Here is the link to the image just for reference. https://drive.google.com/file/d/0B0zHBJb86qsIUFpWMm1ra3dfc1k/view
$("#headermile").on({//task list in header
  focus:function(){
      $('#mileheader').attr("class", "");
  }, 
  blur:function(){    
    $('#mileheader').click(function (e) {
      if (e.target.id == 'mileheader') {
        $("#mileheader").attr("class","");
      } else {
        $("#mileheader").attr("class","hide");
      }
  });
<li class="has-dropdown">
  <a id="headermile" href="#">Milestones </a>
  <div id="mileheader" class="hide">
    <ul class="dropdown settings">
    </ul>
  </div>
</li>
 
     
     
    