Topic: Change select value programmatically

smachesney free asked 3 years ago

Hi, can you show me with a snippet how to programmatically change the select value. I do it this way:


and it sometimes work and sometimes doesn't.

If I did is this way as per your website:

const selectEl = document.getElementById(`#actionTableCategory-${id}`)
const select = new mdb.Select(selectEl)

It duplicates the select ui.

Thank YouSonia

Michał Duszak staff answered 3 years ago

Hello Sonia,

You can look for an instance of this select. I have prepared a snippet for you.

Best regards,


smachesney free commented 3 years ago

Thank you very much Michal

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: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: 3.2.0
  • Device: desktop
  • Browser: Chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: No