Details

First name:

Last name:

Full name:

CodeForm   FriendsForm  mouseOver   mouseOut
Planets   GiftBasic   GiftAjaxSave  extender

<p>First name: <input data-bind="value: firstName" type="text" /></p>
<p>Last name: <input data-bind="value: lastName"  type="text" /></p>
<p>Full  name: <span  data-bind="text:  fullName" ></span></p>
<script>   

    var viewModel = {
        firstName: ko.observable("Bert"),
        lastName:  ko.observable("Smith")
    };
    viewModel.fullName = ko.computed( function () { return this.firstName() + " " + this.lastName(); }, 
                                        viewModel );

    ko.applyBindings(viewModel);
</script>
 
<p>First name: <input data-bind="value: firstName" type="text" /></p>
<p>Last name: <input data-bind="value: lastName"  type="text" /></p>
<script>

    var KOviewModel = function () {
        var self = this;
        self.firstName = ko.observable("Bert");
        self.lastName  = ko.observable("Smith");
    };
    var viewModel = new KOviewModel();

    ko.applyBindings(viewModel);
</script>