我已经使用 javascript、html 和 jquery 开发了 android phonegap 应用程序。我正在使用动态复选框并且我使用了单击功能,但有时在某些设备中,我很难单击复选框以选中和取消选中。然后我将其更改为ontouchend 但随后所有复选框都被单击。但我需要检查组中的任何一个。解决方案是什么。
这是我的代码:
$("input[type='checkbox'][name='"+$(this).attr('name')+"']").live('touchend',function() {
var currentAnswer=this;
$("input[name='"+$(this).attr('name')+"']").attr('checked', false);
currentAnswer.checked=true;
});
请指导我。在此先感谢。