Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset=utf-8 />
  <title>JS Bin</title>
    
</head>
<body>
  
  <p>First name: <input data-bind="value: firstName" /></p>
  <p>Last name: <input data-bind="value: lastName" /></p>
  
  <span data-bind="text: firstName"></span>
  <span data-bind="text: lastName"></span>
    
  <script src="http://cdnjs.cloudflare.com/ajax/libs/knockout/2.2.1/knockout-min.js"></script>
  <script>
        
    var ViewModel = function (first, last) {
      
      this.firstName = ko.observable(first);
      this.lastName = ko.observable(last);
      
      this.fullName = ko.computed(function () {                  
        
        return this.firstName() + " " + this.lastName();
      }, this);
    };
    ko.applyBindings(new ViewModel("Planet", "Earth"));
            
  </script>
  
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers