By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,098 Members | 737 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,098 IT Pros & Developers. It's quick & easy.

How to change the default(blue) color of onFocus element

P: 2
Hi,
I have a coloumn of buttons where i would like to highlight it when focussed... So, i have used onFocus element for it. Till here its ok. But if i set any background color for the button and then use the onFocus element, its not getting focussed that is its not showing as focussed.So,could anybody help me to find out solution for this.
And also tell me how to change the default color of onFocus element to any desired color.
Jun 29 '07 #1
Share this Question
Share on Google+
4 Replies

gits
Expert Mod 5K+
P: 5,390
hi ...

please post some example code. i guess you mean that you are using the onfocus-event of an document-element to do something when the element gets focus? do you set the style through javascript? when we may have a look at the code we could probably help you ... ;)

kind regards ...
Jul 1 '07 #2

drhowarddrfine
Expert 5K+
P: 7,435
If this is a javascript question then you should ask on the javascript board. Otherwise, you should look into using :hover which can probably do what you want without javascript.

btw, onfocus is an attribute, not an element.
Jul 1 '07 #3

P: 8
Another thing to try...

Instead of using the onFocus element, say "screw onFocus", and try the "onMouseover" element, and then to change it back, try the "onMouseout" element....these require NO javascript or external CSS, they are part of the functions of HTML.
Jul 3 '07 #4

gits
Expert Mod 5K+
P: 5,390
Another thing to try...

Instead of using the onFocus element, say "screw onFocus", and try the "onMouseover" element, and then to change it back, try the "onMouseout" element....these require NO javascript or external CSS, they are part of the functions of HTML.
as said already ... onfocus, onmouseover, onblur etc. are attributes of a document-node ... no elements! the tag itself is called an element and it has properties (you don't see them in html) and attributes (you see them like src, href, onclick etc.) that may have assigned a value. using onclick, onblur (imagine as event-handling-attributes to assign a handler to the element) and the similar attributes requires javascript at all until it needs to have the mentioned value ... how would you do something when no javascript-statement is assinged to the atttribute? please give an example!

kind regards ...
Jul 3 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.