I am new working on javascript, and have a problem that is probably very simple to someone with experience.
I have searched previous entries, and tried all I found, with no luck.
What I want to do, is change the color of one line of a variable.
Below is my script.
_____________________________
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
var greet = "<i>Good Morning!</i> "
if (hours>=12){
dn="PM"
greet.fontcolor = '#FF0080"
greet = "<i>Good Afternoon! </i>"}
if (hours>=18){
greet = "<i>Good Evening! </i>"}
if (hours>12){
hours=hours-12
_______________________________
What I want to do is make the "Good Morning" one color,
"Good Afternoon" another, and "good evening a third. So far, nothing has worked, including the "greet.fontcolor...." line shown.
Any help is welcome.
Thanks
Dick
Dick
|========================|
I sure wish there was a way
to receive the best teaching,![[smarty] [smarty] [smarty]](/data/assets/smilies/smarty.gif)
without having to go through
some of the worst experiences!![[ponder] [ponder] [ponder]](/data/assets/smilies/ponder.gif)
|========================|
I have searched previous entries, and tried all I found, with no luck.
What I want to do, is change the color of one line of a variable.
Below is my script.
_____________________________
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
var greet = "<i>Good Morning!</i> "
if (hours>=12){
dn="PM"
greet.fontcolor = '#FF0080"
greet = "<i>Good Afternoon! </i>"}
if (hours>=18){
greet = "<i>Good Evening! </i>"}
if (hours>12){
hours=hours-12
_______________________________
What I want to do is make the "Good Morning" one color,
"Good Afternoon" another, and "good evening a third. So far, nothing has worked, including the "greet.fontcolor...." line shown.
Any help is welcome.
Thanks
Dick
Dick
|========================|
I sure wish there was a way
to receive the best teaching,
![[smarty] [smarty] [smarty]](/data/assets/smilies/smarty.gif)
without having to go through
some of the worst experiences!
![[ponder] [ponder] [ponder]](/data/assets/smilies/ponder.gif)
|========================|