I am using Knockout.js and i am pretty new in this. I created a Example to my problem. Here i am trying to bind the knockout binding to dynamically generated elements. But the binding are not applied properly to dynamically generated elements.
I am trying to synchronize the input text field with label element. So whatever we enter in the input field the same text will reflect in its corresponding label element. Please forgive me if i am not clear with my question and please ask me for clearance. Help me guys ? thanks.
In your code you are not using one of the main feature of
knockout– auto-generating html. Instead of usingjQueryto add new row – use knockoutforeachbinding withobservableArray. When you add new item to array knockout will automatically generate html markup.Javascript:
Html:
Here is working fiddle: http://jsfiddle.net/vyshniakov/g5vxr/