MVC View Color Negative Number Red?

I have a MVC View and html table containing some negative numbers, formatted with leading ( and trailing ) respectfully.


Q. Anyway to place a minus instead fo brackets?
Q. Is Jquery the best way to go?
Q. How do I get the neg nums red?

I have found this JQuery snippet which doesn't work
<td><span id="diff">@group.Diff.ToString("c")</span></td>

<script type="text/javascript">
    $("span:contains('(')").css("red", "#diff");

Open in new window

Who is Participating?
GaryConnect With a Mentor Commented:
This is the whole thing done with jquery
$("span:contains('(')").css("color", "red");
$("span").each(function() {

Open in new window
$("span:contains('(')").css("color", "red");

Open in new window

As for the brackets - it would be easier to do this at runtime.  Why/how are you getting the brackets to start with?
WorknHardrAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.