I have a single select dropdown uses the choices library that includes a remove button and displays a variety of cities:
It's declared in the code as:
<select class="cities-dd" placeholder="Select city:" style="font-size:16px;line-height:24px;font-weight:regular;color:#757575;width:350px;vertical-align:middle;">
<option value="">Select city:</option>`
for(let city of cities){
if (city.length>2){
tab += `<option value="${city}">${city}</option>`;
}};
</select>
I would like to clear the selected city using jQuery. I have tried a bunch of things including clicking the removeItemButton using:
jQuery(".choices__button, input[type='button']").click();
and changing the value to null via
jQuery(".cities-dd").val("").trigger("change");
but nothing seems to be working. Any suggestions would be much appreciated.