MediaWiki:CollapsibleInfobox/code.js

$( function   {    $('+/-').appendTo('.infobox tr.header th');    $(".infobox tr.header").each(function{ var $this = $(this); if( $this.hasClass("hidden") ){ var firstclass = $this.attr("class").split(" ")[0]; $this.siblings("." + firstclass).addClass("hidden"); }  });    $('a.toggle').click ( function (toggle) {       var parent  = $(this).parent ; var grandparent = parent.parent ; var firstclass = grandparent.attr ('class').split(" ")[0];

toggle.preventDefault; grandparent.siblings ('.' + firstclass).has ('td').toggleClass ('hidden'); }   );  } );