JSFiddle - React, Tailwind, and code Playground
by Adam Pavlov
HTML
<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>
JavaScript
$(".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();
}
});
});