JSFiddle - React, Tailwind, and code Playground
by gbhasha
HTML
<script src="http://knockoutjs.com/downloads/knockout-2.2.1.js"></script>
<div>
Wanna see what is next?
<p><label><input type="radio" name="MyChoice" value="True" data-bind="checked: MyChoiceValue" /> Yes</label>
<label><input type="radio" name="MyChoice" value="False" data-bind="checked: MyChoiceValue" /> No</label></p>
</div>
<div data-bind="visible: isVisible">
<h1>Hello World !</h1>
</div>
JavaScript
viewModel = function() {
var self = this;
self.isVisible: ko.observable(''),
self.MyChoiceValue: function() {
if(self.MyChoiceValue() === 'True') {
self.isVisible(true);
} else {
self.isVisible(false);
}
}
};
ko.applyBindings(new viewModel);