How to change DropDownList Selected value in Javascript?

javascript

Solution

You can change it like this:

var ddl = document.getElementById('ddl-id');
var opts = ddl.options.length;
for (var i=0; i<opts; i++){
    if (ddl.options[i].value == "some-value"){
        ddl.options[i].selected = true;
        break;
    }
}

Problem

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

Original source