//The contents of my JavaScript file are as follows:
$mytag.popover({
html:true,
trigger: hover,
container: $mytag,
template: '<div class="popover" role="showDetails">' +
...//other
'</div>',
content:'<div class="info">' +
...//other
'<div class="myrow">' +
'<span>' + 'Result:' + '</span>' +
'<span>' + item.result + '</span>' +
+ '</div>' +
});
The value of item.result is calculated in another part of the JavaScript code. We expect the final result to be a Boolean value. Instead of displaying the outcome directly, we want to append a CSS class.
'<span class="ok">' + '</span>' +
If item.result is true, we want to add the class "ok" to the span tag.
'<span class="ok">' + '</span>' +
If item.result is false, we want to add the class "notOk" to the span tag.
'<span class="notOk">' + '</span>' +
We would appreciate any advice on the best way to achieve this.
Thank you in advance.