if-statement - 为什么我的 if 和 else if 语句没有运行?
问题描述
与标题相同。
const inputs =document.querySelectorAll('input');
inputs.forEach(function(_inputs){
_inputs.readOnly = !_inputs.readOnly;
if(_inputs.readyOnly == false){
_inputs.classList.remove("readOnlyItem")
_inputs.classList.add("notReadOnly")
}else if(_inputs.readyOnly == true){
_inputs.classList.add("readOnlyItem")
_inputs.classList.remove("notReadOnly")
}
});
据我所知,每件事似乎都是正确的,应该可以正常工作,但是 if 语句由于某种原因永远不会返回 true。
解决方案
推荐阅读
- parsing - 如何打印移位或减少语法规则?(弯曲,野牛)
- autodesk-forge - 版本后的查看器。7.37 -- 使用 setAggregatedProperties
- java - 找到以下代码的大 O 复杂度
- android - 安卓工作室 4.1.3。显示基线上下文菜单选项不可用
- python - 从另一个字典中分配一个字典中的值而不指向它
- python - 使用 python 虚拟环境作为部署 python 应用程序的一种方式是一种好习惯吗?
- python - Python函数+字典
- javascript - 带有反应js的paystack
- json - ASP.NET Json 没有出现
- java - 您是否能够将 pojo 事实类添加到口水的 kiebase 中?