Again, more IE headaches...

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Spacemail by SpaceshipSpacemail by Spaceship
Watch

monty

Established Member
Impact
3
Damn, I hate this shitty software more everyday, pardon my French.

My issue is the next JavaScript function:

function menuHomeSwitch() {

//set all items to #B5C4DD for background color
var temp = document.getElementsByName('nav')

for (var x = 0; x<temp.length; x++) {

temp[x].style.background = '#B5C4DD'
}
}

I have an serie of <td> tags with the name 'nav', and like the function shows, all I need to do is set the background colors to a different color. According to the DOM level 1 specification, this should work and it does so in all browsers, ACCEPT IE ofcourse.

Any suggestions before I kill myself?

tnx much!

-monty
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
why don't you use CSS instead ?
 
0
•••
style.background-color='#whatever';
 
0
•••
document.getElementsByName('nav').style.background = '#B5C4DD';

It'd be easier to use a class and some CSS.
 
0
•••
Thanks for helping out everybody!

Dan Friedman said:
document.getElementsByName('nav').style.background = '#B5C4DD';

It'd be easier to use a class and some CSS.

So, I tried this, I changed the function to:

function menuHomeSwitch() {

//set all items to #B5C4DD for background color
document.getElementsByName('nav').style.background = '#B5C4DD'
}

And set the <td> tags class attribute to "nav", but still no joy, this doesn't in other browsers as well. Now, I didn't get much sleep last, so am I missing something here?

-monty
 
0
•••
CatchedCatched

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

Parking: find your domains by pasting a list
You can now paste a list of domain names into the search box at the top of the Parking menu. Put one name on each line. Your domain list...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back