JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" id="checkbox" />&larr;First manually check and uncheck, then click <a href="#" id="check">Check</a>

<br><br>

<select>
  <option value="1">One</option>
  <option value="2">Two</option>
</select>
&larr;First manually select then unselect option Two, then click <a href="#" id="sel">Select option Two</a>

JavaScript

$('#check').click(function () {
  $('input#checkbox').attr('checked', true);
});

$('#sel').click(function () {
  $('select option[value=2]').attr('selected', true);
});