I\'ve a super simple knockout code below:
var data ={
\"Id\" : 1001,
\"SalePrice\" : 12345,
\"ListPrice\" : 333,
\"ShortDesc\" : \"Tayler 123
Check out the fiddle.All you need to do is this
This will populate the span element with sale price defined in the view model.
From your question it appears to me that what you are trying to do is bind the view model to different elements of the html page. To achieve this you can pass an id parameter to the apply bindings to bind a specific view model to a specific section of the page. Like this
ko.applyBindings(viewmodel,document.getElementById('id'));
If you are looking to directly access the view model use the binding context. In this case you need the $data binding context.So the binding in span will change to