id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,blockedby,blocking 9641,toggleClass failed on element with id set.,activex88,activex88,"When test toggleClass function on elements with id defined, it failed. A simple example would be as, {{{ An external style sheet ""toggleClass.css"" defined as: body { background: black; } div#left { background: gold; border: 1px solid #AAA; width: 80px; height: 80px; margin: 0 5px; float:left } div#center { background: gold; border: 1px solid #AAA; width: 80px; height: 80px; margin: 0 5px; float:left } div#right { background: gold; border: 1px solid #AAA; width: 80px; height: 80px; margin: 0 5px; float:left } .colored { background: green; } p { color: Blue; font-size: 2.5em; } .highlight { background:orange; } Html document (""toggleClass.html""): toggleClass Demo

Results show here.

a javascript file ""toggleClass.js"": $(document).ready(function () { $(""#run"").click(function () { $(""#center"").toggleClass(""highlight""); $(""p"").html($(""#center"").css(""background-color"")); }); function AnimateDiv() { $(""#center"").slideToggle(""slow"", AnimateDiv); } $(""p"").click(function () { $(this).toggleClass(""highlight""); }); AnimateDiv(); }); }}} ",bug,closed,low,1.next,effects,1.6.1,invalid,,,,