How to change DropDownList Selected value in Javascript?

前端 未结 2 1164
逝去的感伤
逝去的感伤 2020-12-15 22:51

how to change the selected value in javascript and get the selected value in codebehind page? AutoPostBack is set to false.

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-15 23:32

    You can change it like this:

    var ddl = document.getElementById('ddl-id');
    var opts = ddl.options.length;
    for (var i=0; i

提交回复
热议问题