Instead of putting an id on the element and getting it like this here you should use a knockout binding. See https://github.com/FredrikNoren/ungit/blob/master/public/source/main.js for examples of other bindings I've created here, and http://knockoutjs.com/documentation/custom-bindings.html for documentation on how it works.