making input fields blank when clicking a button using knockout only

I want to use only knockout to implement the following: - I want to make my input fields blank when "button1" is clicked and display the values back when "button2" is clicked. The input fields are data binded by their respective observables. So, I am not sure how I should make the observables null and then display them back when button2 is clicked. Code: \[code\]var ViewModel = function() { var self = this; self.comment = ko.observable("hi there"); self.message = ko.observable("hello"); }vm = new ViewModel(); ko.applyBindings(vm);\[/code\]My approach: Here are the two methods I tried implementing but did not work at all:\[code\]myShow: function() { comment = ko.observable(""); },myHide: function() { message = ko.observable(""); },\[/code\]I will appreciate any help. Thanks.
 
Back
Top