[jQuery] checkbox in li keeps unchecking itself

[jQuery] checkbox in li keeps unchecking itself


Hi,
I have the following html
<ul>
<li><input class="xx" type="checkbox"> text
<ul>
<li></li>
</ul>
</li>
</ul>
with code like this:
$("input").filter(".xx").click(function(){
//alert('name: ' + $(this).attr("name") + ' ' + 'class: ' + $
(this).attr("class") + ' ' + 'id: ' + $(this).atr("id"));
// code should come here
return false;
});
$("li").click(function(){
$(this).children().children("li").each(function() {
if ($(this).css("display") == 'none') {
$(this).show();
} else {
$(this).hide();
}
});
return false;
});
The second function is supposed to open/close child <ul>-s when
clicking on the "text"
of a list item. This works well.
The first function is supposed to do some other stuff but I am stuck
as any time I click
on the checkbox it gets checked and then immediately afterwards
unchecked.
I can see this happening if I enable the alert.
How can I convince it to stay checked and to do my code in the upper
code and not not trigger
the "li" related code in the second function?
regards
Gabor