All html should be in the template, you only need to data-bind the src (i.e. in the template: <img data-bind="attr: { src: imageUrl }"> and a imageSource = ko.observable() in the code)