JSFiddle - React, Tailwind, and code Playground
by ducka
HTML
<select data-bind="options: options, selectedOptions: selected, optionsText: 'text', optionsValue: 'value'" multiple="multiple"></select>
<span data-bind="text: ko.toJSON(selected)"></span>
JavaScript
var vm = {
options: ko.observableArray([
{ text: 'Test 1', value: 1 },
{ text: 'Test 2', value: 2 },
{ text: 'Test 3', value: 3 }
]),
selected: ko.observableArray([1, 4, 3])
};
ko.applyBindings(vm);