Drop down selection changed event

https://groups.google.com/d/topic/knockoutjs/U8LA3u4ktTk/discussion

by Pratik Bhoir

HTML

<select data-bind="options: choices, value: selectedChoice"></select>
<hr />
<select data-bind="event: { change: selectionChanged }">
    <option>A</option>
    <option>B</option>
    <option>C</option>
</select>

JavaScript

var viewModel = {
    choices: ["one", "two", "three"],
    selectedChoice: ko.observable("two") ,
    selectionChanged: function(event) {
         alert("the other selection changed");  
    } 
};

viewModel.selectedChoice.subscribe(function(newValue) {
   alert("the new value is " + newValue); 
});


ko.applyBindings(viewModel);