Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get value of dropdown menu in semantic ui?

I have this code but I don't know how to get selected value.Where should i give id value for this list?

<div class="ui compact menu">
    <div class="ui simple dropdown item">Question
        <i class="dropdown icon"></i>
        <div id="question" class="menu">
            <div id="type" class="item" data-value="mcsc">Multiple Choice Single Correct</div>
            <div id="type" class="item" data-value="mcmc">Multiple Choice Multiple Correct</div>
            <div id="type" class="item" data-value="numerical">Numerical</div>
        </div>
    </div>
</div>
like image 928
Shravan Kumar Avatar asked May 31 '16 16:05

Shravan Kumar


People also ask

Is a drop-down list that allows users to select one value from a set?

A drop-down list (abbreviated drop-down, or DDL; also known as a drop-down menu, drop menu, pull-down list, picklist) is a graphical control element, similar to a list box, that allows the user to choose one value from a list. When a drop-down list is inactive, it displays a single value.

How do I add a search drop-down in HTML?

Use any element to open the dropdown menu, e.g. a <button>, <a> or <p> element. Use a container element (like <div>) to create the dropdown menu and add the dropdown links inside it. Wrap a <div> element around the button and the <div> to position the dropdown menu correctly with CSS.

Is it drop-down or dropdown?

Should I use "drop-down menu" or "dropdown menu" in writing? When writing documentation or describing a drop-down menu, use "drop-down menu" unless you're describing a function, option, or command with no hyphen.


1 Answers

You must use something like this:

$('#idDropDown').dropdown('get value');

I hope that helps you.

Docs for this can be found in last table here: https://semantic-ui.com/modules/dropdown.html#/usage

like image 131
Nicolasie Avatar answered Oct 03 '22 02:10

Nicolasie