DOM question
- Started
- Last post
- 10 Responses
- jf
All i want is for a div's bg to change color. Cant seem to find any good documentation on DOM naming.
function rollon(id){
id.style.backgroundColor='801919...
function rolloff(id){
id.style.backgroundColor='000000...works in IE PC but not on moz or macIE
help?
- jf0
i know its easy, cmon yall.
- jf0
has anyone else noticed that if you squint at my profile it looks like i have a beard?
- MattFlecher0
http://www.alistapart.com/storieā¦
lots of info here.
just from looking...
try adding a # to your hex code.
- digitalspiri0
do you want 'em to change colour onmouseover or something?
- illtronix0
first you have to identify the target object this way
targetdiv=document.getElementByI... of your div');
then you can say
targetdiv.style.backgroundColor... color
adding '#' shouldnt make a diff but its goodie good praktees
- illtronix0
...addendum
unless u already took care of that in another function...
- unknown0
"try adding a # to your hex code. "
haha, very true.
I made this simple stupid mistake a while ago as well...
- jf0
it was the # btw
anyone have a gun?
- illtronix0
wow.
- digitalspiri0
try putting this in the DIV tag itself:
onmouseover="this.style.backgrou...
onmouseout="this.style.backgroun...
DS