T
Terry
Hi folks.
I was wondering why it seems that I can't obtain the properties that
have to been assigned to a tag through use of css.
For example if I have:
css:
#theli {
display:inline;
background-color: green;
padding-left:10px;
padding-right:10px;
}
html:
<li id="theli">Hi there</li>
And I have in a javascript function that is called when the page is
loaded:
alert("color = " +
document.getElementById("theli").style.backgroundColor);
document.getElementById("theli").style.backgroundColor = "black";
alert("color = " +
document.getElementById("theli").style.backgroundColor);
The first alert only shows color = (with nothing else)
while the second alert shows color = black
Any ideas as to why I don't see green at the end of the first
color: ?
the url to my page is http://restaurant.atwebpages.com/contactus.htm
I was wondering why it seems that I can't obtain the properties that
have to been assigned to a tag through use of css.
For example if I have:
css:
#theli {
display:inline;
background-color: green;
padding-left:10px;
padding-right:10px;
}
html:
<li id="theli">Hi there</li>
And I have in a javascript function that is called when the page is
loaded:
alert("color = " +
document.getElementById("theli").style.backgroundColor);
document.getElementById("theli").style.backgroundColor = "black";
alert("color = " +
document.getElementById("theli").style.backgroundColor);
The first alert only shows color = (with nothing else)
while the second alert shows color = black
Any ideas as to why I don't see green at the end of the first
color: ?
the url to my page is http://restaurant.atwebpages.com/contactus.htm