How to close bootstrap dropdown menu on button click?

You can do this by adding a button or a label anywhere to close the drop-down menu.

For this you need a trigger and a little script code.

<button class="btn btn-danger kapat" type="submit">Arama</button>

By using this in the Script Code, you can enable the button to be used only in the area where it is found.

$(".kapat").click(function() {
	    $(this).closest(".dropdown-menu").prev().dropdown("toggle");
	});

0 Yorum

Soru & Yorum


Web Tasarım

Renkli Kare

Web Tasarım Ajansı