JSFiddle - React, Tailwind, and code Playground
HTML
<select id="mySelect">
<option value="div1">div1</option>
<option value="div2">div2</option>
</select>
<div id="div1" style="background:red;height:100px;width:100px;">
<form></form>
</div>
<div id="div2" style="display:none;background:blue;height:100px;width:100px;">
<form></form>
</div>
JavaScript
document.getElementById("mySelect").addEventListener("change", myFunction);
function myFunction() {
var x = document.getElementById("mySelect").value;
if(x=="div1"){
document.getElementById("div1").style.display="block";
document.getElementById("div2").style.display="none";
}else if(x=="div2"){
document.getElementById("div2").style.display="block";
document.getElementById("div1").style.display="none";
}
}