
如果您使用的是jQuery,则可以编写click事件。
$('.input-large').click(function() { var checked; if ($(this).is(':checked')) { checked = true; } else { checked = false; } $.ajax({ type: "POST", url: "/tasks/complete", data: { id: $(this).data('post-id'), checked: checked } }); });欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)