Why don't you add an attribute to the input after you change it's value programmatically like this:
HTML:
<button
onClick="changeAttribute"
type="button">Programmatically change Country
</button>
Javascript:
function changeAttribute() {
document.getElementById("country").setAttribute("autocomplete", "off");
}
Keep in mind that you might want to adjust this code to your requirements.