What specific content is contained in the file named select.txt?
- 内容介绍
- 文章标签
- 相关推荐
本文共计99个文字,预计阅读时间需要1分钟。
javascriptselect.txt: select 初始化
功能:通过选项值初始化下拉框。
代码:javascriptfunction selectInitByOptionValue(selectId, optionValue) { var select=document.getElementById(selectId); for (var i=0; i /**
* select 初始化
* @param selectId
* @param optionValue
*/
function selectInitByOptionValue(selectId, optionValue) {
var select = document.getElementById(selectId);
for (var i = 0; i < select.options.length; i++) {
if (select.options[i].value == optionValue) {
select.options[i].selected = true;
break;
}
}
}
本文共计99个文字,预计阅读时间需要1分钟。
javascriptselect.txt: select 初始化
功能:通过选项值初始化下拉框。
代码:javascriptfunction selectInitByOptionValue(selectId, optionValue) { var select=document.getElementById(selectId); for (var i=0; i /**
* select 初始化
* @param selectId
* @param optionValue
*/
function selectInitByOptionValue(selectId, optionValue) {
var select = document.getElementById(selectId);
for (var i = 0; i < select.options.length; i++) {
if (select.options[i].value == optionValue) {
select.options[i].selected = true;
break;
}
}
}

