When you use the {{each}} syntax in jQuery templates, the data context is related to what the generic template is associated with. In your case, this is a complete view model.
Several variants:
1- you can use your current code and pass the element that you are "attached" to a function of the type ( http://jsfiddle.net/rniemeyer/qB9tp/1/ ):
<div data-bind="click: function() { $root.deleteImage($value); }">Delete</div>
Using an abnormal function in data binding is pretty ugly. There are better options.
2- you can use the foreach template binding parameter, which works with jQuery templates and is more efficient than {{each}} like ( http://jsfiddle.net/rniemeyer/qB9tp/2/ ):
<script type="text/html" id="imgsList"> <div style="float:left; margin: 10px 10px 10px 0;"> <div> <a href="${Filename}">${Filename}</a> </div> <div data-bind="click: $root.deleteImage">Delete</div> </div> </script> <div data-bind="template: { name: 'imgsList', foreach: model.Imgs }"></div>
Now the template context is a separate image object, and a call to $root.deleteImage will pass it as the first argument.
3- Since the jQuery Templates plugin is deprecated and Knockout now supports native templates, you might want to remove your dependency on the jQuery Templates plugin. You can still use a named template (you just need to replace any jQuery Templates syntax with data binding attributes), for example: http://jsfiddle.net/rniemeyer/qB9tp/3/ or even remove the template and just go with the foreach control flow binding, for example : http://jsfiddle.net/rniemeyer/qB9tp/4/
<div data-bind="foreach: model.Imgs"> <div style="float:left; margin: 10px 10px 10px 0;"> <div> <a data-bind="text: Filename, attr: { href: Filename }"></a> </div> <div data-bind="click: $root.deleteImage">Delete</div> </div> </div>
4- Although I prefer option No. 3, you can even use event delegation and attach a live handler, for example: http://jsfiddle.net/rniemeyer/qB9tp/5/
$("#main").on("click", ".del", function() { var data = ko.dataFor(this); viewModel.deleteImage(data); });
This can be especially useful if you bind a large number of the same handlers using click bindings (for example, in a grid).