phonegap と javascript の使用
動的に作成された UL リストがあり、2 つのチェックボックスがあります。LI 項目を手動で追加すると、クリック機能が正常に機能します。
しかし、li アイテムを動的に追加すると、クリック機能が起動しません。
//This is the code that I use to populate the UL list
if (records[r_key].name.indexOf("#") == -1) {
$('#ItemSelection').append('<li><p class="name">' + records[r_key].name +'</p><input type="checkbox" id="w' + records[r_key].id +'" class="markedplayer"><input type="checkbox" id="s' + records[r_key].id + '" class="markedwinner"></li>');
}
//This is the code to do something when any box is checked
$(":checkbox").click(function() {
if (this.checked){
//do something
} else {
//something else if not checked
}
});