JSFiddle - React, Tailwind, and code Playground
HTML
<form id="adv-settings" action="" method="post">
<h5>Show on screen</h5>
<div class="metabox-prefs">
<label for="gridblog-hide"><input class="hide-postbox-tog" name="gridblog-hide" type="checkbox" id="gridblog-hide" value="gridblog">Grid Information</label>
<label for="postcustom-hide"><input class="hide-postbox-tog" name="postcustom-hide" type="checkbox" id="postcustom-hide" value="postcustom">Custom Fields</label>
<label for="commentstatusdiv-hide"><input class="hide-postbox-tog" name="commentstatusdiv-hide" type="checkbox" id="commentstatusdiv-hide" value="commentstatusdiv">Discussion</label>
<label for="commentsdiv-hide"><input class="hide-postbox-tog" name="commentsdiv-hide" type="checkbox" id="commentsdiv-hide" value="commentsdiv">Comments</label>
<label for="slugdiv-hide"><input class="hide-postbox-tog" name="slugdiv-hide" type="checkbox" id="slugdiv-hide" value="slugdiv">Slug</label>
<label for="authordiv-hide"><input class="hide-postbox-tog" name="authordiv-hide" type="checkbox" id="authordiv-hide" value="authordiv">Author</label>
<label for="revisionsdiv-hide"><input class="hide-postbox-tog" name="revisionsdiv-hide" type="checkbox" id="revisionsdiv-hide" value="revisionsdiv">Revisions</label>
<label for="pageparentdiv-hide"><input class="hide-postbox-tog" name="pageparentdiv-hide" type="checkbox" id="pageparentdiv-hide" value="pageparentdiv" checked="checked">Page Attributes</label>
<label for="postimagediv-hide"><input class="hide-postbox-tog" name="postimagediv-hide" type="checkbox" id="postimagediv-hide" value="postimagediv">Featured Image</label>
<br class="clear">
</div>
</div>
<div><input type="hidden" id="screenoptionnonce" name="screenoptionnonce" value="aa67b33445"></div>
</form>
<label class="screen-reader-text" for="page_template">Page Template</label>
<select name="page_template" id="page_template">
<option value="default" selected="selected">Default Template</option>
<option...
CSS
div.hide-if-js {
display: none;
}
JavaScript
$('#gridblog').hide();
$('#page_template').live('change', function(e) {
if ($(this).val() === "page-gridblog.php") {
$('#gridblog').show();
$('#gridblog-hide').prop('checked', true);
}
}).change();
$('#page_template').change(function() {
$('#gridblog').hide();
});