function check(el){
for (var i = 0; i<el.options.length; i++) {
var opt = el.options[i];
var el_id = opt.getAttribute('data-id');
document.querySelector('input[data-id="'+el_id+'"]').checked = opt.selected;
}
}
<button type="submit" id="half_map_update" class="btn btn-primary btn-block"><?php echo esc_html__('Update', 'exnv'); ?></button>