javascript - How to open bootstrap dropdown by external button click -


i've read half of internet, find clear example on how this. bunch of "solutions" nothing works far..

here's tried:

$('#openner').on('click', function(e){     e.preventdefault();     // nothing works bellow :(     //$('.dropdown-toggle').trigger('click');     //$('.dropdown-toggle').click().parent().addclass('open');     //$('.dropdown-toggle').trigger('click.bs.dropdown'');     $('.dropdown-toggle').click().addclass('open'); }); 

jsfiddle

try:

$('#openner').on('click', function(e){    $('ul[aria-labelledby="dropdownmenu1"]').toggle(); }); 

jsfiddle: http://jsfiddle.net/mluarcdc/4/


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -