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>

Recommended Answers

All 2 Replies

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>");

yes that worked perfect,
thank you so much JorgeM

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.