Making button's borderColor equal to linkColor

K

KKramsch

I want the border color of this button to be the same as
document.linkColor. How can I implement this?

My best solution has been to have the onload handler for the page
find the button and set its style.borderColor attribute to the
desired color. Is there a better way?

Many thanks in advance,

Karl
 
J

Java script Dude

My best solution has been to have the onload handler for the page
find the button and set its style.borderColor attribute to the
desired color. Is there a better way?

You can set buttons to use a css class say <input type=button
class=lcButton...

You can then dynamically change the style specified in javascript
onload of the document. I don't have the exact syntax for changing the
css style in front of me but I have seen others do it and I've done it
sometime in the past.

If you have many buttons on the page, this method would theoretically
be more efficient since you don't have to find all the buttons in the
DOM

Another method would be to detect the document.linkColor at the top of
the body (just after body tag) and use document.writes for your
buttons forcing in the inline style at that time. Not sure if
document.linkColor is initialized at that point though.

JsD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top