Topic: select - add / remove values dynamically in JS
Is there any example how I can set options on an existing select
field dynamically with javascript?
Kamila Pieńkowska staff answered 9 months ago
You cannot set options on existing Select if it was initiated. You need to dispose of it and then init with new options.
If you want to know how to initialize select with JS here is an example: https://mdbootstrap.com/snippets/standard/kpienkowska/6043307
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 6.4.2
- Device: any
- Browser: any
- OS: any
- Provided sample code: No
- Provided link: No