I am using knockout to bind view to viewmodel.
I have my view as
<table>
<tr>
<td data-bind ="text: ConcenatedData"></td>
</tr>
</table>
My view model makes ajax call and binds data to observable array
function showData() {
return $.ajax({
url: "../Service/EmpData",
type: "PUT",
contentType: 'application/json',
processData: false,
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(errorThrown);
},
success: function (allData) {
var Data = $.map(allitems, function (item) {
return new EmpList(item);
});
self.EmployeeData(Data);
}
});
}
function EmpList(items) {
this.EmpName = ko.observable(data.EmpName);
this.EmpId = ko.observable(data.EmpId);
this.ConcenatedData = ko.observable(data.ConcenatedData);
}
I get Data in my observable as <temp>Is this Emp required</temp>in our company
So i want to make text bold between tag <temp> and </temp>.
So output will be Is this Emp required in our company`
How to achieve this?
Update
I have created fiddle here I want the text between tag <temp> and </temp>.
to be bold.
temp{font-weight: bold;}
– Ivan Chernykh<style>
tags like any other CSS. Or you could put it in the<temp>
selector if you're able to by doing<temp style="font-weight:bold">
– Zach Saucier