views:

56

answers:

1

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';
}
+1  A: 

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.

bobince
Look like the OP edited too much...
BalusC
No that was something I added to test but I guess that was even wrong. The whole statement isn't in there.
creocare