Topic: MDB5 initialize a dinamically created select item

soiware priority asked 1 year ago

I create dynamically a select item. But it is not rendered in MDB5 style. Same behavior if I load the html source embedding select items dinamically into the main page. I know I have to execute this code in order to initialize input text in similar situation:

// Input init, due to late loading of the html
document.querySelectorAll('.form-outline').forEach((formOutline) => {
    new mdb.Input(formOutline).init();

Is there a similar init procedure for select?

Mateusz Lazaru staff answered 1 year ago


Im not 100% sure if I understood the case. You simply want to initialize select using JS code instead of adding select class?

Let me know if the code helps you or not:

soiware priority commented 1 year ago

Thank you mlazaru your code is fine! This is what I was looking for.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.10.1
  • Device: Any
  • Browser: Any
  • OS: Any
  • Provided sample code: No
  • Provided link: No