# JS FF Or IE problem

**URL:** https://forum.kirupa.com/t/js-ff-or-ie-problem/174641
**Category:** Uncategorized
**Created:** [January 7, 2006, 5:27pm UTC](https://forum.kirupa.com/t/js-ff-or-ie-problem/174641 "2006-01-07T17:27:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![StarXploser](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/starxploser/32/875_2.png) [@StarXploser](https://forum.kirupa.com/u/StarXploser)
#### Post date: [January 7, 2006, 5:27pm UTC](https://forum.kirupa.com/t/js-ff-or-ie-problem/174641/1 "2006-01-07T17:27:11Z")

</div>

Code Sample

//WORKS FOR FF but NOT IE

function change(id){  
c1 = document.getElementById(“c1”);  
c2 = document.getElementById(“c2”);  
c3 = document.getElementById(“c3”);

```
m1 = document.getElementById("m1"); 
m2 = document.getElementById("m2"); 
m3 = document.getElementById("m3"); 

if(id==1)
{
    c1.style.display = ""
    m1.style.color = "#cc0000";
    
    c2.style.display = "none";
    m2.style.color = "#444444";
    
    c3.style.display = "none";
    m3.style.color = "#444444";
}

```

* * *

//WORKS FOR IE but NOT FF  
//notice that i deleted the 1st 6 lines.

function change(id){  
if(id==1)  
{  
c1.style.display = “”  
m1.style.color = “#cc0000”;

```
    c2.style.display = "none";
    m2.style.color = "#444444";
    
    c3.style.display = "none";
    m3.style.color = "#444444";
}

```

i tried renaming the vars in the statements like:  
c3 = document.getElementById(“c3”);

it’s not helping.

I thought about checking for the browser but There are more browser than just IE and FF, and I would have no way to check it.

and the 2nd reason im not checking for different browser is that i think that the problem comes from me.

Any idea anyone?

Thx
