JSFiddle - React, Tailwind, and code Playground
HTML
<input type="button" id="start" value="Отправить">
<br>
<output id="out"></output>
CSS
output {
font-family: monospace;
white-space: pre;
}
JavaScript
var btn = document.getElementById('start');
btn.addEventListener('click', function(){
btn.value = "start"; //проблема тут
out.textContent += 'start ' + +new Date() + '\n'
var xhr = new XMLHttpRequest();
xhr.open('POST', '/echo/json/');
xhr.onload = function(e){
if(xhr.readyState == 4 && xhr.status == 200){
btn.value = "ready";
out.textContent += 'ready ' + +new Date() + '\n'
}
};
xhr.send();
});