Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    style - button border color changing

    I'm trying to change the color of the button's border from a script. I have the button and the border-color feature of it's style attribute, but I cannot seem to affect it from scripts other than to make it disappear.

    I'm working in IE6, and the netscape version is also pending, so I need both where I can get them.

    so far, the following fail to accomplish my goal:

    document.all("theButton").style.border="FF0000";
    document.all("theButton").style.bordercolor="FF0000";

    Any other suggestions? Thanks in advance.
    If at first you don't succeed, spend more time online researching javascript!
    Beck

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    style.borderColor with a capital "C"

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    muchas gracias

    thanks x_goose_x, it's exactly what I was looking for. Fully appreciate it.
    If at first you don't succeed, spend more time online researching javascript!
    Beck

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Any style attribute that is spelled out with a hyphen as a rule, needs to be camelCased for it to be accessed as a property

    font-size becomes fontSize
    border-color becomes borderColor
    background-image becomes backgroundImage

    etc
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •