Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


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

engineer_yasin premium asked 4 years 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 4 years ago

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



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Opened

Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB jQuery
  • MDB Version: 4.12.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: Yes