title: How to combine these two codes in knockout.js?
body: <p>js and this is one of my first programs.I have two pieces of code in separate files and I don't know how to work these two pieces of code into one code.I know this looks pretty easy but me bieng a newbie , your help will be highly appreciated.</p>
  
  <pre><code>//Knockout file to add/ remove rows
         &lt;html&gt;
         &lt;script src="C:\Users\neha.uniyal\Downloads\knockout-3.3.0.js"      type="text/javascript"&gt;&lt;/script&gt;
          &lt;script&gt;
           function InsertRow(name) {
          var self = this;
          self.name = name; 
            }
  
          function AppViewModel() {
          var self = this;
  
          // Editable data
          self.rows = ko.observableArray([
              new InsertRow(""),
  
          ]);
          self.addRow= function() {
              self.rows.push(new InsertRow(""));
          }
          self.removeRow= function(row) { self.rows.remove(row) }
              }
  
                 ko.applyBindings(new AppViewModel());
          &lt;/script&gt;
         &lt;body&gt;
         &lt;h2&gt;Application&lt;/h2&gt;
  
          &lt;table&gt;
          &lt;thead&gt;&lt;tr&gt;
              &lt;th&gt;File name&lt;/th&gt;
          &lt;/tr&gt;&lt;/thead&gt;
          &lt;tbody data-bind="foreach:rows"&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;input data-bind="value: name" /&gt;&lt;/td&gt;
                 &lt;td&gt;
                  &lt;select&gt;
                  &lt;option value="yes"&gt;Yes&lt;/option&gt;
                  &lt;option value="no" selected&gt;No&lt;/option&gt;
                 &lt;/select&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;a href="#" data-bind="click: $root.removeRow"&gt;Remove&lt;/a&gt;&lt;/td&gt;
              &lt;/tr&gt;    
          &lt;/tbody&gt;
         &lt;/table&gt;
  
         &lt;button data-bind="click:addRow"&gt;Add Row&lt;/button&gt;
         &lt;/body&gt;
         &lt;/html&gt;
  
  
  //File to display upload-file control on selecting yes option:
   &lt;html&gt;
         &lt;script src="C:\Users\neha.uniyal\Downloads\knockout-3.3.0.js"      type="text/javascript"&gt;&lt;/script&gt;
          &lt;script&gt;
      var viewModel = {
      types: ["Yes", "No"],
      type: ko.observable("No"),
      isType: function(type) {
         return type === this.type();   
      }
  };
  
  ko.applyBindings(viewModel);
  
          &lt;/script&gt;
         &lt;body&gt;
        Choose : &lt;select data-bind="options: types, value: type"&gt;&lt;/select&gt;
  &lt;hr/&gt;
  &lt;span data-bind="visible: isType('Yes')"&gt;&lt;input type = "file"&gt; &lt;/span&gt;
  &lt;span data-bind="visible: isType('No')" &gt;&lt;/span&gt;
  
         &lt;/body&gt;
         &lt;/html&gt;
  </code></pre>