JSFiddle - React, Tailwind, and code Playground
by skram
HTML
<FORM>
<input type="radio" name="search_type" value="A"/>type A<br/>
<input type="radio" name="search_type" value="B"/>type B<br/>
</FORM>
JavaScript
$(document).ready(function(){
$('input:radio[name="search_type"]').change(function() {
if ($(this).val() == 'A'){
alert('type A');
}
if ($(this).val() == 'B'){
alert('type B');
}
});
});