JamesTBennett
JamesTBennett

Reputation: 2301

Works in firefox but not IE8

This is working fine in firefox but only closes the first page and then breaks in IE8. Firebug in IE8 says that x.item(o) is null. I can't figure out why this works in firefox but not IE. Thanks for any help.

pager(x=document.getElementsByName("pg1"));

function pager( x ) {
    var curr = document.getElementById('showing');
    $(curr).fadeOut('fast');
    curr.id = 'hide';
    $(x).fadeIn('slow');
    x.item(0).id ='showing';
}

Upvotes: 0

Views: 227

Answers (1)

bobince
bobince

Reputation: 536329

if(x.item(0).id = NULL )

That's an assignment. You wanted == for comparison.

(What's NULL in capital letters? An element's id property won't be null; if it's not set, it'll be an empty string.)

It seems to me you'd be better off using jQuery's toggle method.

Upvotes: 1

Related Questions