this is my select input field
<form action="payment.html" method="post" class="creditly-card-form agileinfo_form">
<section class="creditly-wrapper wrapper">
<div class="information-wrapper">
<div class="first-row form-group">
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="inputGroupSelect01">Pharmacies</label>
</div>
<select class="custom-select" id="inputGroupSelect01">
<option selected="">Choose...</option>
<option value=""> </option>
</select>
</div>
this is my javascript code
function searchPharmacy(lat,lng){
$.post('http://127.0.0.1:8000/api/checkout',{lat:lat,lng:lng},function(match){
// console.log(match);
$.each(match, function(i,val){
var pharmlatval=val.pharmacy_lat;
var pharmlngval=val.pharmacy_lng;
var pharmname=val.pharmacy_state;
var picn='https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png';
PLatLng = new google.maps.LatLng(pharmlatval, pharmlngval);
createMarker(PLatLng,picn,pharmname);
document.getElementById('inputGroupSelect01').value=pharmname;
console.log(pharmname);
});
});
}
i want to output the value of the variable pharmname on the select input form field. how do i go about it.