I have a bootstrap dropdown menu. I want it to be kept open when I click inside it, but closed when clicking the dropdown toggle button or outside of the menu.
It seems like the dropdown does not close when I type something in the input
but it closes when I click anywhere else inside the dropdown.
Q: How can I avoid this by using jQuery?
Below is my HTML:
<div id="navbar">
<nav class="navbar navbar-default navbar-static-top" role="navigation">
<div class="collapse navbar-collapse" id="navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">MENU</a>
<div class="dropdown-menu">
<p>HELLO</p>
<input>
</div>
</li>
</ul>
</div>
</nav>
</div>