The Bootstrap drop-down menu does not close by clicking outside

advertisements

In my application I have added close button side bootstrap dropdown. Clicking on that close button I have to close that dropdown. This is working properly, but when I click anywhere outside dropdown, dropdown is not closing Here is Fiddle : goo.gl/3RAkBw

Can any one tell me how can I close


You can try this:

$(document).on('click',function(){
    $('#layers').hide();
  })