0

I'm Doing a Javascript and jQUery animation and it is working quite fine in all browsers less in Internet Explorer, it shows this alert: '0.width is null or not an object' take a look at the code here: http://jsfiddle.net/3y8cN/

It's a animated Percent bar, that works just fine in Chrome, but not in IE, looks that the problem is in the if:

if (barracent[0].style.width != '0'){
    multiplier[0].innerHTML = value1+'%';
}

How can I avoid that Problem?

Yes, I Know that I can use loops to avoid that big code, I'll do it later. Thanks a lot in Advance.

Feel The Noise
  • 654
  • 2
  • 11
  • 31

1 Answers1

1

DIV's do not support the 'name' attribute, and so document.getElementsByName('barracent') is not returning any elements in IE (other browsers must not have this restriction). Check out this answer for more details on the issue.

Community
  • 1
  • 1
Briguy37
  • 8,342
  • 3
  • 33
  • 53