JSFiddle - React, Tailwind, and code Playground
HTML
<fieldset>
<legend>אפשרויות חיפוש:</legend>
<p>
<label class="OptionSearchlabel" for="normal-search">חיפוש רגיל</label>
<input type="radio" name="OptionSearch" id="normal-search" class="OptionSearch" />
</p>
<p>
<label class="OptionSearchlabel" for="inList">חיפוש בתוך הרשימה</label>
<input type="radio" name="OptionSearch" id="inList" class="OptionSearch" />
</p>
<p>
<label class="OptionSearchlabel" for="outList">חיפוש מחוץ לרשימה</label>
<input type="radio" name="OptionSearch" id="outList" class="OptionSearch" />
</p>
</fieldset>
JavaScript
var id;
$(".OptionSearch").mousedown(function () {
if (this.checked) id = this.id;
});
$(".OptionSearchlabel").mousedown(function () {
var checkId = this.attributes.for.value;
if ($("#" + checkId)[0].checked) id = checkId;
});
$(".OptionSearch").click(function () {
if (this.checked && id == this.id) {
$("#normal-search").prop("checked", true);
id = "normal-search";
}
});