Not sure about your intention, but what if you focus not on the markup but on the view models. For example, define the fields in view model and swap the values, not actual markup. like following: http://jsfiddle.net/tabalinas/Y3M6n/1/
<div id="div1" class="row" data-bind="text: text1">
</div>
<br/>
<div id="div2" class="row" data-bind="text: text2">
</div>
var vm = {
text1: ko.observable("Div 1"),
text2: ko.observable("Div 2"),
submit: function() {
var temp = vm.text1();
vm.text1(vm.text2());
vm.text2(temp);
}
};
I doubt that custom bindings should be used for this purpose. It's usually used to create some reusable component or specific event.
If I'm wrong, clarify your intentions, and I'll try to help.