How to change text color in Details View via Javascript?

How to change text color in Details View via Javascript?

I have tried the scrip below, but only works in table view.

// Replace view_1 and field_2 with your view and field keys
//$(document).on(‘knack-view-render.view_1’, function(event, view, data) {
// $("#view_1 td.field_2").each(function() {
// #ff0000 is red and the #1c631f is green
// var textColor = ($(this).find(“span”).text().trim() == “Expired”) ? “#ff0000” : “#1c631f”;
// $(this).css(“color”, textColor);
// })
//});

Hello! do you still need help with this?