the value in the option tag is Other
but you are comparing it with other
you should change it like this:
window.onload = function () {
var eSelect = document.getElementById('transfer_reason');
var optOtherReason = document.getElementById('otherdetail');
eSelect.onchange = function () {
var selectedValue = eSelect.options[eSelect.selectedIndex].value;
//OR
selectedValue = eSelect.value;
//BUT the important point is using toLowerCase() like this
if (selectedValue.toLowerCase() == "other") {
optOtherReason.style.display = 'block';
} else {
optOtherReason.style.display = 'none';
}
}
}
Or just do this:
if (selectedValue.toLowerCase() == "Other") {//replace the "other" with "Other"
optOtherReason.style.display = 'block';
} else {
optOtherReason.style.display = 'none';
}