JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" id="captureImage" name="add_image" class="custom" />

JavaScript

$("#captureImage").live("change", function() {
    // $("#captureImage").prop('checked', false); // Here Work
    alert($("#captureImage:checked").val());
    if($("#captureImage:checked").val() != "undefined") {
        try
          {
            navigator.device.capture.captureImage(function(mediaFiles) {
            console.log("works");
             });
          }
          
        catch(err)
          {
          alert('hi');
            $("#captureImage").prop('checked', false); // Not Works Here
            
          }
            
    }
});