It worked fine in FF, but keep getting an error in IE

Object required, in JS file, Line 21, Char 8;

.

function ShowBox(id, num)
{
    var i;
    var bigIMG = new Array(num);

    for(i=0; i<=bigIMG.length; i++){

      bigIMG[i] = "c" + i;
      var thisBig = bigIMG[i];

      if(bigIMG[i] == id){
          obj = document.getElementById(thisBig);
          obj.style.display = 'block';
      }else{
          obj2 = document.getElementById(thisBig);
          obj2.style.display = 'none'; // line 21

          }

    }
}

if I change the code: for(i=0; i<=bigIMG.length; i++) to for(i=0; i<bigIMG.length; i++), the error will go away, however, the last item in the array which is bigIMG[num], its display will not be set to "none".

Any suggestion will be appreciated!

Fixed it!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.