28 lines
853 B
JavaScript

var modify = {}
modify.showModifyPassword = function() {
let modifyType = document.getElementById('modifyType').value
let info = {
modifyPasswordLis: document.getElementsByClassName('modifyPassword'),
modifymobileNoLis: document.getElementsByClassName('modifymobileNo'),
}
// 遍历隐藏所有元素
for (let key in info) {
let elements = info[key];
for (let item of elements) {
item.style.display = 'none'; // 确保所有相关元素被隐藏
}
}
// 根据 modifyType 显示相关元素
if (modifyType === "2") {
for (let item of info.modifyPasswordLis) {
item.style.display = 'block';
}
} else if (modifyType === "3") {
for (let item of info.modifymobileNoLis) {
item.style.display = 'block';
}
}
}