JSFiddle - React, Tailwind, and code Playground

by Joe

HTML

<div class="formEntryArea">
<div class="formEntryLabel">
    <span class="formLabel"><label for=" langdropdown">Would you like to receive library notices in English or Spanish? ><span class="formRequired">*</span></label></span>
</div>
    <div class="formMultiSelect" id=”langdropdown”>
<select name="langdropdown" id='MySelect'>
<option value="0" selected="selected">Choose language</option>
<option value="eng">English</option>
<option value="spa">Spanish</option>
<input type="text" id="ddepartment" name="ddepartment"  value=''>

JavaScript

var myselect = document.getElementById("MySelect");
myselect.onchange = function(){
/* alert(myselect.options[myselect.selectedIndex].value); */
document.getElementById("ddepartment").value = myselect.options[myselect.selectedIndex].value;
};