添加期末大作业文件夹Project,目前与Assignment5中一致
This commit is contained in:
28
Project/static/js/modify.js
Normal file
28
Project/static/js/modify.js
Normal file
@@ -0,0 +1,28 @@
|
||||
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';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user