Topic: Dynamic initializatino for select
PiotrMD priority asked 1 year ago
Hi,
Currently for dynamically added "input" element in the form there is initialization available as shown on the md page:
document.querySelectorAll('.form-outline').forEach((formOutline) => {
new mdb.Input(formOutline).init();
});
Is there similar initialisation for "select" element added dynamically via javascript ?
Mateusz Lazaru staff answered 1 year ago
yes, there is a way to initialize dynamically added select:
const mySelect = new mdb.Select(document.getElementById('mySelect'), options)
https://mdbootstrap.com/docs/standard/forms/select/#api-section-usage
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 6.2.0
- Device: Dell Laptop
- Browser: Edge
- OS: Windows 10
- Provided sample code: No
- Provided link: No