CreativeIT / getmdl-select

Select for material-design-lite
http://creativeit.github.io/getmdl-select/
MIT License
301 stars 87 forks source link

Clear selected item by code #108

Open gregoryscode opened 4 years ago

gregoryscode commented 4 years ago

Hello, how can I clear selected value and set get-mdl-select to its initial state by javascript?

Thank you.

dolhaid commented 4 years ago

Hello! This solution worked for me:

document.querySelector('#select-text')[0].parentElement.MaterialTextfield.change(''); document.querySelector('#select-value').val(0);

Developer66 commented 3 years ago

This worked for me: getmdlSelect.init('.getmdl-select');