JSFiddle - React, Tailwind, and code Playground

by PsyComa

HTML

<script src="https://github.com/downloads/SteveSanderson/knockout/knockout-2.0.0.js"></script>
<select data-bind="options: optionValues"></select>

<button data-bind="click: save">Save</button>

JavaScript

function ViewModel()
{
    var self = this;
    self.optionValues= ko.observableArray(["Test1", "Test2", "Test3"]);
    self.selectedValue = ko.observable();
    
    self.save = function()
        {
            //selectedValue should containt the selected value from dropdown list and will be send to the server    
        }
}

ko.applyBindings(new ViewModel());