I need remove the attribute \"checked\" of one checkbox when errors occur.
The .removeAttr function not work. Any idea? :/
HTML
You could try $(this):
$("#captureAudio").live("change", function() {
if($(this).val() !== undefined) { /* IF THIS VALUE IS NOT UNDEFINED */
navigator.device.capture.captureAudio(function(mediaFiles) {
console.log("audio");
}, function() {
$(this).removeAttr('checked'); /* REMOVE checked ATTRIBUTE; */
/* YOU CAN USE `$(this).prop("checked", false);` ALSO */
_callback.error;
}, {limit: 1});
}
});