JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://semantic-ui.com/dist/semantic.css">
<script src="http://semantic-ui.com/dist/semantic.js"></script>
<div class="ui right floated labeled icon top right pointing dropdown button" id="select-filter" tabindex="0">
<i class="filter icon"></i>
<span class="text">Kommentare filtern</span>
<div class="menu transition hidden" tabindex="-1">
<div class="header">
<i class="filter icon"></i>
Kommentare filtern
</div>
<div class="active item selected" data-value="all"> alle anzeigen </div>
<div class="item" data-value="filter_helpful"> Nur hilfreiche Kommentare anzeigen </div>
<div class="item" data-value="all_with_deleted"> alle + gelöschte </div>
</div>
</div>
CSS
body {
padding: 1em;
}
JavaScript
$(function() {
$.each($(".ui.dropdown"), function(i, dropdown) {
var val = $(dropdown).find(".item.active").data("value");
var text = $(dropdown).find(".item.active").html();
$(dropdown)
.dropdown("set value", val)
.dropdown("set text", text)
.dropdown({onChange: function(){alert(1);}});
});
});