So I’ve got this tricky (at least for me) script to write/modify. You can see below how it looks right now:
HTML:
<div class="holder" style="float: left; margin-right: 20px">
<input type=checkbox class="checkbox" checked="checked" />
<h2>Lorem ipsum</h2>
</div>
<div class="holder" style="float: left; margin-right: 20px">
<input type=checkbox class="checkbox" checked="checked" />
<h2>Lorem ipsum</h2>
</div>
<div class="holder" style="float: left; margin-right: 20px">
<input type=checkbox class="checkbox" checked="checked" />
<h2>Lorem ipsum</h2>
</div>
<div class="holder" style="float: left; margin-right: 20px; clear: right">
<input type=checkbox class="checkbox" checked="checked" />
<h2>Lorem ipsum</h2>
</div>
<div class="number">
0
</div>
Javascript:
var increment2=1;
$('.checkbox').live('click', function() {
$('.number').html( '(' + increment2 + ')');
increment2++;
})
What needs to be done is that when you check on of the boxes the h2 content of the container should appear in the ul as li. If there are 3 boxes checked, than in the ul will be 3 li etc… when you uncheck the box it’s ofcourse being removed from the ul.
I hope my explanation is making sens. Can anyone help?
I made few minor changes to your html and implemented below code,
DEMO here