How can I get selected values from Multiselect?

web
mobile

Topic: How can I get selected values from Multiselect?

SKQR01 asked 3 months ago

Expected behavior I need to get selected values from Multiselect. Actual behavior I cant do this, because I dont know how. Resources (screenshots, code snippets etc.) I try get values with JQuery: $('element:selected').val() $('element:selected').text() But I do nothing


Mateusz Łubianka staff answered 3 months ago

@SKQR01

I created the snippet with example code. Check out the link: https://mdbootstrap.com/snippets/jquery/mateusz-lubianka/1516465?action=forum_snippet

If you click on the button, you will get the array with values in your console.

Best,


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: jQuery
  • MDB Version: 4.5.12
  • Device: Laptop
  • Browser: Opera
  • OS: Linux Ubuntu 18.04
  • Provided sample code: No
  • Provided link: No