Value of semantic selected value dropdown


#1

hi, does anyone know how I can get the selected value of a dropdown in my event?
http://semantic-ui.com/modules/dropdown.html#/usage

Ok I already solved it:

<div class="ui selection dropdown">
            <input type="hidden" id="currentUser">
            <i class="dropdown icon"></i>
            <div class="default text">User</div>
            <div class="menu">
                {{#each users}}
                <div class="item" data-value="{{name}}" data-text="{{name}}">
                    <i class="male icon"></i> {{name}}
                </div>
                {{/each}}
            </div>
        </div>


'change #currentUser' (event, template) {
        // Prevent default browser form submit
        var currentUser = template.$("#currentUser")
            .val();
        Session.set('currentUser', currentUser)
        console.log('de current user in the session is: ', currentUser);

#2

Try something like

var currentUser = $('.selection.dropdown').dropdown('get value');

look under http://semantic-ui.com/modules/dropdown.html#behavior