JSFiddle - React, Tailwind, and code Playground
HTML
<form>
<select>
<option onclick="hide('1','2');">Show textbox 1</option>
<option onclick="show('1','2');">Show all</option>
</select>
<br/>
<input id="1" type="text" value="blah 1" style="display:none;"/>
<input id="2" type="text" value ="blah 2" style="display:none;"/>
</form>
JavaScript
function hide(a,b){
document.getElementById(a).style.display='block';
document.getElementById(b).style.display='none';
}
function show(a,b){
document.getElementById(a).style.display='block';
document.getElementById(b).style.display='block';
}