<fieldset style="border: 1px solid #dfffdf;padding: 15px;"><legend></legend><div>SEAT NUMBER:- <b>{{ seat.seatNumber }}</b></div><hr><div id="form" class="form"><div class="row"><div class="col-lg-6 col-md-6" style="text-align: right;"><button class="btn btn-success" style="width: 110px;" onclick="book({{ seat.seatNumber }})">Book</button></div><div class="col-lg-6 col-md-6" style="text-align: left;"><button class="btn btn-warning" style="width: 110px;" onclick="reserve({{ seat.seatNumber }})">Reserve</button></div></div></div></fieldset><script>function book(seat){$.get('/bus/trip/{{ trip.id }}/seat/'+seat).then(function (response){console.log($($.parseHTML(response)).find("div#seatDetails"));// $('div#mpesa_id').replaceWith($(response).find('div#mpesa_id'));$('div#seatDetails').html(response);});}function reserve(seat){$.get('/bus/trip/{{ trip.id }}/seat/'+seat+'/reserve').then(function (response){console.log($($.parseHTML(response)).find("div#seatDetails"));// $('div#mpesa_id').replaceWith($(response).find('div#mpesa_id'));$('div#seatDetails').html(response);});}</script>