Mythical Fish
Mythical Fish

Reputation: 293

IE and JavaScript (jQuery) problems

I have a page that has multiple tabs that toggle the display of hidden elements. It uses the following js:

$('document').ready(function() {

// Profile Tabs
$('ul.profile_tabs li').click(function(){
    var type = $(this).attr('type');

    $('.content-profile-title').css('display', 'none');
    $('.content-profile-display').css('display', 'none');

    $('#content-profile-title-'+type).css('display', 'block');
    $('#content-profile-display-'+type).css('display', 'block');

});
});

It grabs the type attribute of the ul element, and unhides the element with the corresponding ID.

Its working fine in FF and other browsers, just not IE! I get the following console message: "Object doesn't support this property or method" I've tried other methods like show/hide fadeIn/fadeOut..

Any help would be muchly apreciated :)

Upvotes: 0

Views: 77

Answers (1)

AutoSponge
AutoSponge

Reputation: 1454

Don't use attributes to hold data. But if you have to, try something like title which is available to most elements.

Upvotes: 1

Related Questions