Topic: Append new Material select after initialized the first one, doesn't work.

aklaunch free asked 3 years ago

Expected behavior Initialize the Material select and then append new Material select to the page. and the new Material select will work fine and will show up the options. Actual behavior After initialize Material select all work fine. but after appending new Material select to the body the new Material select doesn't open and not working at all. i tried to destroy the Material select and initialize again but it did not help.

Resources (screenshots, code snippets etc.)

lemons free commented 3 years ago

you can give the dynamically added select an ID and then initialize only this select $('#dynamicallyAddedSelect').materialSelect();

Mateusz Łubianka staff answered 3 years ago

Hi @pavan_kp,

You should add id for new select:

elem.setAttribute("id", x);

And init by ID:


If it isn't any solution of your problem please, create a snippet showing your problem here: I'll try to help you.


lassekofoed free answered 3 years ago

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

  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.10.1
  • Device: browser
  • Browser: chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: No