how to Manually select an option from the Material select?


Topic: how to Manually select an option from the Material select?

engineer_yasin premium asked a year ago

I want to select usa when the button is clicked, how to?

Resources (screenshots, code snippets etc.)

https://mdbootstrap.com/snippets/jquery/engineer_yasin/1725060


Grzegorz Bujański staff commented a year ago

Did you try this: $('button').on('click', () => { $('.mdb-select option[value="1"]').attr('selected', 'true') });


Please insert min. 20 characters.