EDIT
I am still baby in writing Javascript and I need your help in understanding how it works so please bear with me.
Say, if I want to have “Singapore” append to the textfield on the webpage automatically when the user picks “Singapore” in country select dropdown, how or where do I need to append the “Singapore” text to the state/city textfields on webpage? See image example.

HTML code

Javascript
function appendtoText(){
var country = document.getElementById("billing_country_select");
var state = document.getElementById("billing_province_input");
var city = document.getElementById("billing_city");
if (country.value == "Singapore"){
state.value = state.append("Singapore");
alert(state.value);
city.append("Singapore");
}
}
I am not sure where I went wrong with this. State and City don’t show the appended text: Singapore. So please correct me if I went wrong in coding.
Thanks for the help in advance
To add the value of the Country field to the state field:
When the Billing Country field is changed, the Billing State/Province value automatically becomes ” – Billing Country“. If the chosen country were Singapore, it would become ” – Singapore”. I’m making a very simple assumption about how you want this to work, so if this isn’t what you need, let me know and I will refine it as needed.