|
Hi Jakob,
Try this
document.getElementById("test").style: border-top: 2px solid green;
Regards,
Sarbjit
|
|
Expert:
|
multani.sarbjit
|
|
Date:
|
Sep 14, 2006
|
|
Time:
|
07:18
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
Hi jakob,
"borderTop" is the right way to refer to that property
document.getElementById("test").style.borderTop = "2px solid green";
/Anpanman
|
|
Expert:
|
Anpanman
|
|
Date:
|
Sep 14, 2006
|
|
Time:
|
09:18
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
Anpanman, you're right. Quite simple!
|
|
Expert:
|
jgivoni
|
|
Date:
|
Sep 14, 2006
|
|
Time:
|
14:04
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
Jakob,
As Anpanman points out, dropping the hyphen in border-top will give you the desired results. This is carried over for all of the hyphenated styles:
background-color = backgroundColor
font-weight = fontWeight
margin-top = marginTop
etc.
I've also found that case is important to some of the browsers with strict interpretation, so make sure the second "word" in the attribute is capitalized.
Something to look at that really helps with javascript (as well as other things HTML) is the Visibone charts found at http://www.visibone.com. I've got the "Card Collection" book, and there isn't a day that I don't look at it to find something I'm trying to resolve.
I hope this helps, too...
|
|
Expert:
|
rcastagna
|
|
Date:
|
Sep 14, 2006
|
|
Time:
|
14:11
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
|
|
|
|
This question has been answered, and points have been rewarded to the following experts:
You're welcome however to comment or give additional information or if you wish, you have the ability to write an Answer Summary for this question by clicking on the "Answer Summaries" Tab.
|
|