Jump to content

GetElementById


vytas
 Share

Recommended Posts

I want to use the GetElementById tag to change the appearance of the textSuch as:

<html><head><style type="text/css">p {color: green}</style></head><body><p id="text">Hello and Welcome to my site</p><script type="text/javascript">{var r= get Hours()if (r<=15){document.GetElementById("text") (and here i dont know how to acces the color of my text)}}</script></body></html>

Pls i need some help

Link to comment
Share on other sites

I didn't work maybe an error in my script ???

<html><head><style type="text/css">p {color: green}</style></head><body><p id="text">Hello and Welcome to my site</p><script type="text/javascript">{var r= getHours()if (r<=18){document.GetElementById("text").style.color ="red";}else{document.style.GetElementById("text").color ="red";}}</script></body></html>

This is what i have now but it still didn't workI fixed the problemthank you

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...