I'm writing the code to change the Button element value when the click event is executing.
But Until it finishes it doesn't affect the button element value.
I attached the fiddle example which will give you a good idea of what I'm talking about.
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";
alert('hi')
}
Even the button element innerHTML changed before alert, it doesn't affect the UI.
How can I accomplish, before the alert is executed I need to change the button text?
Thanks.