Monday, 19 August 2013

Display message in Knocout.js

Display message in Knocout.js

I have button called Fact. I want it to display message "true" when
someone clicks it. My HTML looks like this:
<div id="option">
<button data-bind="click: displayMessage">Fact</button>
<div data-bind="if: displayMessage">You are right.</div>
My Javascript is this:
ko.applyBindings({
displayMessage: ko.observable(false)
});
However, this is not working. Can someone please help.

No comments:

Post a Comment