I have a minimum code testing a java script in apache and it is not filling the text
<!DOCTYPE html>
<html>
<head>
<script text=javascript>
var select = document.getElementById('dropdown');
select.addEventListener('change', function(event) {
var select = event.target;
var indiceSeleccionado = select.selectedIndex;
var elementoSeleccionado = select.options[indiceSeleccionado];
var texto = document.getElementById('mytext');
texto.value = select.value;
})
</script>
</head>
<input type="text" id="mytext">
<select id="dropdown" >
<option value="">None</option>
<option value="text1">text1</option>
<option value="text2">text2</option>
<option value="text3">text3</option>
<option value="text4">text4</option>
</select>
</body>
</html>