Skip to content

get the selected item from dropdown #2579

Answered by jamessampford
hemna asked this question in General
Discussion options

You must be logged in to vote

I want to be able to add more items on the fly

Think you’d need to re-init the dropdown with the values as per https://fomantic-ui.com/modules/dropdown.html#initializing-with-javascript-only or $(‘.ui.dropdown’).dropdown(‘change values’, values); - i don’t think there’s anything to append on an item

I also need to get the current selection and when the user changes the selection from js. How do I do this with jquery?

Can use the onChange callback otherwise can use $(‘.ui.dropdown’).dropdown(‘get value’);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lubber-de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants