function EquType() { var equtypeid = $("#adEquipmentTypeID").val(); if (equtypeid == "1") //串口扫描器 { document.getElementById("adIpAddress").readOnly = true; document.getElementById("adIpAddress").style.backgroundColor = "#dddddd"; document.getElementById("adIpPort").readOnly = true; document.getElementById("adIpPort").style.backgroundColor = "#dddddd"; } else { document.getElementById("adIpAddress").readOnly = false; document.getElementById("adIpAddress").style.backgroundColor = "#ffffff"; document.getElementById("adIpPort").readOnly = false; document.getElementById("adIpPort").style.backgroundColor = "#ffffff"; } if (equtypeid == "2")//网络扫描器 { //com口 document.getElementById("adComPort").readOnly = true; document.getElementById("adComPort").style.backgroundColor = "#dddddd"; var s = document.getElementById("adComPort"); //选择框 s.disabled = true; } else { document.getElementById("adComPort").readOnly = false; document.getElementById("adComPort").style.backgroundColor = "#ffffff"; var s = document.getElementById("adComPort"); //选择框 s.disabled = false; } }
input框选中时如何不出灰框_js设置文本框和选择框为灰色不可编辑
最新推荐文章于 2022-04-01 09:27:17 发布