<body>
<div class="top-bar">...</div>
<div class="content">
<div class="left">
<!-- other components -->
<div class="bottom">
<div class="ui selection dropdown">
<input type="hidden" name="gender">
<i class="dropdown icon"></i>
<div class="default text">Gender</div>
<div class="menu">
<div class="item" data-value="1">Male</div>
<div class="item" data-value="0">Female</div>
</div>
</div>
</div>
</div>
</body>
When click the dropdown, it works.
It does not work and the click function dose not bind to it.
Semantic 2.4
It seems that the click function should manually bind to dropdown. And it works with the following code.
window.onload = function(){
$('.ui.dropdown').dropdown();
};
Don't know why with deeper html structure, the dropdown could not work. Hope it could be fixed.
This is misleading from the manual. Your code always needs the initialization via javascript.
Only the simple DropDown works without Javascript:
https://semantic-ui.com/modules/dropdown.html#simple
<div class="ui compact menu">
<div class="ui simple dropdown item">
Dropdown
<i class="dropdown icon"></i>
<div class="menu">
<div class="item">Choice 1</div>
<div class="item">Choice 2</div>
<div class="item">Choice 3</div>
</div>
</div>
</div>
Only the simple DropDown works without Javascript:
https://semantic-ui.com/modules/dropdown.html#simple<div class="ui compact menu"> <div class="ui simple dropdown item"> Dropdown <i class="dropdown icon"></i> <div class="menu"> <div class="item">Choice 1</div> <div class="item">Choice 2</div> <div class="item">Choice 3</div> </div> </div> </div>
Thanks! I didn't see that.
Most helpful comment
Only the simple DropDown works without Javascript:
https://semantic-ui.com/modules/dropdown.html#simple