JSFiddle - React, Tailwind, and code Playground

by sjs96

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<form id="searchid" method="post" action="test.php">
                                    
                                 <label><input name="search" id="radio" type="radio">test1</label><br>
                                 <label><input name="search" id="radio" type="radio">test2</label><br>
                                 <label><input name="search" id="radio" type="radio">test3</label>
                    </form>

JavaScript

var form = document.getElementById("searchid");
		document.getElementById("radio").addEventListener("click", function () {
		  form.submit();
		});