New to Javascript

  • Thread starter Steven Sinfield
  • Start date
S

Steven Sinfield

Hi There,

I've been trying to work out a function that would change my text color
depending on what text is displayed in a particular field. But I seem to be
getting myself into one big mess with it.

What I want to be able to is have a specific color for a specific string of
text. I am sure this can be done but I dont know how, I have search google
and still havent come up with a solution.

The line I am try to change text on is this;

<tr>
<td class="style2"><span class="style3"><?php echo $status; ?></span></td>
</tr>

can this be done?

Always greatful for you guru's help

Steve
 
J

Joshie Surber

Always greatful for you guru's help

Will mine work instead? :)
What I want to be able to is have a specific color for a specific string of text.

The easiest way to do this would be to use PHP to echo the status in
the span (<span class="style3 <?php echo $status;?>"> then assign the
different colors in the CSS
span.status1{ color: red }
span.status2{ color: blue }
 
D

Danny

If your field/text will be the output of some processing due to user
interaction, then use JS but be specific on the scenario, not ambiguous, if
the field/text will be static once served from the server preprocessed or
not, use the server language, ASP, PHP or whichever, but, same, be
specific.


Danny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top