JSFiddle - React, Tailwind, and code Playground
HTML
<form>
<select onchange="changeFirstSelect(this)">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<select id="second">
<option>Please select the first option</option>
</select>
</form>
JavaScript
var changeFirstSelect = function(element) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == XMLHttpRequest.DONE) {
document.getElementById('second').innerHTML = xhr.responseText;
}
}
xhr.open('GET', 'http://example.com?val1='+element.value, true);
xhr.send(null);
}