JSFiddle - React, Tailwind, and code Playground
by dilettante
HTML
<p class="large-detail">42 bucks</p>
<a href="#" class="take-bet-link" data-id="77" data-point="90" data-val="yup" data-dismiss="modal">Take bet at 42 bucks</a>
JavaScript
$(".take-bet-link").click(function() {
var id= $(this).attr('data-id');
var point= $(this).attr('data-point');
var val= $(this).attr('data-val');
var takeurl = '/api/response.json?point='+ point + '&claimId=' + id + '&type=' + val;
var newPrice ='';
alert('hi' );
$.post(takeurl, function(data) {
var newPrice = json.data.newPrice;
alert('hi' );
}, "json");
$(this).parents("tr").find(".large-detail").html(newPrice);
return false;
});