html
html绑定到DOM元素上,使得该元素显示的HTML值为你绑定的参数。如下代码:
<div data-bind="html: details"></div>
js代码如下:
var viewModel = {
details: ko.observable()
};
viewModel.details("<em>For further details, view the report <a href='report.html'>here</a>.</em>");
ko.applyBindings(viewModel);
练一练html绑定吧。