Drop down selection changed event

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

by kougiland

HTML

<script src="http://rniemeyer.github.com/KnockMeOut/Scripts/jquery.tmpl.js"></script>
<script src="http://knockoutjs.com/downloads/knockout-2.2.1.debug.js"></script>
<select data-bind="options: choices, value: selectedChoice"></select>

JavaScript

var viewModel = {
    choices: ["one", "two", "three"],
    selectedChoice: ko.observable("two")
};

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


ko.applyBindings(viewModel);