JSFiddle - React, Tailwind, and code Playground

by Gregory Guidero

HTML

<script src="http://knockoutjs.com/downloads/knockout-3.1.0.js"></script>
<!-- This is a *view* - HTML markup that defines the appearance of your UI -->
<input id="range" type="range" min="0" max="100" value="0" /><p data-bind="text: sliderValue"></p>

JavaScript

// This is a simple *viewmodel* - JavaScript that defines the data and behavior of your UI
var viewModel = new AppViewModel();
function AppViewModel() {  
    this.sliderValue = ko.observable(0);
    
}
var range = document.getElementById('range');
range.addEventListener('input',function(){
    viewModel.sliderValue(this.value);
});

// Activates knockout.js
ko.applyBindings(viewModel);