Your problem is you are not targeting the elements you want to apply your bindings to with your ko.applyBindings call.
side note, dont use the same vm variable for the view models. that is going to cause a nightmare later when, just use vm1 & vm2 but i would recommend something more descriptive.
Im assuming you have 2 divs you want to apply your templates to, lets call them temp1 & temp2. Your code to set the templates with the different view models should be
var vm1 = ...
var vm2 = ...
ko.applyBindings(vm1, document.getElementById("temp1"));
ko.applyBindings(vm1, document.getElementById("temp2"));
notice how i pass the DOM element as the second parameter to the applyBindings call? thats how you target only a specific template when applying bindings.
Sadly this is all the documentation has to say about it:
Knockout : Activating Knockout[
^]
Also: take a look at
Knockout : The "click" binding[
^] for your click functions.