Take the 2-minute tour ×

I'm trying to get a checkbox to work correctly within a according header (including the click event), i've found an example on how to do this with an older version of jquery (version 1.6.3) at http://jsfiddle.net/CkL2r/1/ or the code is below;

<div id="accordion">
<h3><a href="#">Text <span id="id">More text <input type="checkbox"/></span></a></h3>
<div>content etc</div>
<div>content etc</div>

$('#accordion input[type="checkbox"]').click(function(e) {

I just can't get it to work with newer version of jquery, i searched the jquery docs and as far as i can tell there shouldn't be any difference of this function between version.

Can anyone point me in the right direction?

share|improve this question
Which version are you trying to get it to work with? It works fine with 1.7.2 –  mcpDESIGNS Nov 27 '12 at 18:12
Works fine in 1.8.2: jsfiddle.net/NqYKw –  mccannf Nov 27 '12 at 18:17
add comment

1 Answer

I think your problem was a trivial one..

When you select jQuery 1.6.3 , you have a checkbox that says to include jQueryUI library in the fiddle.

But when you select jQuery 1.8.2 you don't have the option. So you need to include that file manually in the Add resources section.

Updated Fiddle

share|improve this answer
I've just added a resource (code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css) and it still doesn't work. It does when using version version 1.7.0 like in the fiddle you provided. –  Nathan Nov 27 '12 at 18:30
You are adding the .css file.. What about the .js file ?? Check this fiddle jsfiddle.net/sushanth009/CkL2r/207 –  Sushanth -- Nov 27 '12 at 18:35
the js file is also included: code.jquery.com/ui/1.9.2/jquery-ui.js –  Nathan Nov 27 '12 at 19:39
add comment

Your Answer


