Below is a function that I need help with. It's a simple function that changes the text color to green when the eventStatus shows as Active
:
function() {
var diff, status;
diff = moment().diff(date, 'days')
if (diff > 0) {
status = 'Ended';
}
if (diff < 0) {
status = 'Pending';
}
if (diff === 0) {
status = 'Active';
//status.style.color = "#132111"
// document.getElementById('greenActive').style.color = "green"
}
return status;
}
UPDATE HTML:
<td id = "status-column" >
<span id="greenActive" >{{eventStatus}}</span>
</td>
I tried using both 'status.style.color' and 'getElementById', but the text wasn't showing up at all.
Can you pinpoint where I went wrong?
Your assistance is greatly appreciated!