I did show/hide on the checkbox when I check BUTTON appear and when I uncheck BUTTON disappear, I am trying when I hide BUTTON then checkbox should uncheck
$(".btn-close").hide();
$(".btn-close").click(function() {
$(this).hide();
});
$(function() {
$("#fileTypeS1").click(function() {
if ($(this).is(":checked")) {
$(".btn-close.image").show();
} else {
$(".btn-close.image").hide();
}
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="checkbox" name="freeAsset" value="valuable" id="fileTypeS1"><br>
<button type="button" class="btn-close image" aria-label="Close">
Images <span aria-hidden="true">×</span>
</button>