Sweetalert2: Default value on sweet alert select

Created on 13 Jul 2016  路  3Comments  路  Source: sweetalert2/sweetalert2

I have a select sweet alert (select with options) and i would like to make a default value, is there anyway? i wanted to make "selected='selected' " but i can't find any option to make this achievable.
Help please.

Thanks

Most helpful comment

There's inputValue parameter which you can use for setting the initial value of a select: https://jsfiddle.net/L87xem1y/1/

All 3 comments

There's inputValue parameter which you can use for setting the initial value of a select: https://jsfiddle.net/L87xem1y/1/

I don't think this is documented on the website. inputValue doesn't mention select inputs

I don't think this is documented on the website. inputValue doesn't mention select inputs

Good point @Herz3h! I just improved the docs: https://sweetalert2.github.io/#input-value

Was this page helpful?
0 / 5 - 0 ratings