JSFiddle - React, Tailwind, and code Playground

by Vivek kt

HTML

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<body>
<h1>Some title</h1><br />

<form action="" id="trans_type">
<b>What would you like?</b><br />
<input type="radio" name="transaction_type" value="2">Sell&nbsp;&nbsp;&nbsp;
<input type="radio" name="transaction_type" value="3">Buy
</form>
<div id="object_type">message comes here</div>


</body>

JavaScript

$(document).ready(function(){
  $("#trans_type").click(function(){
    $('#realty_type').html("<b>Loading response...</b>");
      var test =$('input[name=transaction_type]:checked').val();
      alert(test);
    $.post("sql_s.php",
    {
       test: test,
    city:"New York"
    },
    function(data,status){
    document.getElementById("object_type").innerHTML = data;
    });
  });
});