get selected option text in knockout

后端 未结 3 1797
情歌与酒
情歌与酒 2020-12-19 02:50

I am using knockoutjs to bind a select list. Here is a Sample , I want to get selected option text instead of selected value.

How to get it using knockoutjs ?

<
3条回答
  •  情书的邮戳
    2020-12-19 03:36

    The simplest way to do it is to remove the optionsValue binding. When you don't sepcify the optionsValue binding, the entire item will be the selected value.

    
    Selected Project:
    
    

    See fiddle

提交回复
热议问题