Details

First name:

Last name:

Full name:

»ShopNameCart: Northwind ShopNameCart: Household items
»KnockOut! List Products By Category (local Parent Child Foreign Key View Model) KnockOut! Client Side Local Diffferent Model Source
»A jQuery menu/accordian Using KnockOut data Model

<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>

<script>
     function KOviewModel () {                 /* Or: var KOviewModel = function () */
        var self = this;
        self.firstName = ko.observable("Bert");
        self.lastName  = ko.observable("Smith");
        self.fullName = ko.computed( function () { return this.firstName() + " " + this.lastName(); },
                                     this );
    };
    var viewModel = new KOviewModel();

    ko.applyBindings(viewModel);
</script>