0

so i have this script for a countdown and i would like to have the font color to be white, but i can not figure it out.
thanks

<script type="text/javascript">

today = new Date();

BigDay = new Date("<?php require("date.php"); ?>");
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
document.write(" " + daysLeft + " days " + hrsLeft +" hours and " + minsLeft + " minutes left ");

    if (timeLeft < 0) {
    window.location = "welcome.php"
    }
</script>
2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by Tko_1
1

In the most simple terms.. just wrap what you are writing to the screen within a span element and style the color property.

"<span style='color:#FFFFFF'> " + daysLeft + " days " + hrsLeft +" hours and " + minsLeft + " minutes left </span>");

0

yes that worked perfect,
thank you so much JorgeM

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.