function SetUtcTimeZone() {
var UTCTimeZone = document.getElementById("txtPortorAnchorDeparture").value;
document.getElementById('ddlUTCTimeZone').selectedIndex = UTCTimeZone;
}
<小时/>
如何使用 dropdownlist id 将文本框值设置为 dropdownlist
最佳答案
我想它看起来像这样:
function SetTxt() {
var indx = document.getElementById('ddlUTCTimeZone').selectedIndex;
var val = document.getElementById('ddlUTCTimeZone').options[indx].text;
document.getElementById("txtPortorAnchorDeparture").value = val;
}
关于javascript - 我们如何将文本框值设置为下拉列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42873608/