Topic: How to Change mdb-select option with jquery
webdesigna
pro premium asked 9 months ago
How to Change mdb-select option with jquery? I usually use: $('#mdb-select').val(valueoption).trigger('change'); but in the last versión doesn´t work.
Please help me Thanks
Krzysztof Wilk
staff answered 9 months ago
Hi!
You selected material select using id ($('#material-select')), but it doesn't have id. You can try add attribute id="material-select" to your select or choose by class $(".material-select") and your solution should work :)
I made a sample snippet for you, you can check it here: https://mdbootstrap.com/snippets/jquery/krzysztof-wilk/2224428
Answered
- User: Pro
- Premium support: Yes
- Technology: jQuery
- MDB Version: 4.19.0
- Device: all
- Browser: all
- OS: Mac
- Provided sample code: No
- Provided link: No