style="display:none;"
<scriptlanguage="javascript">functionpysjzx_change(){varleaseObj=document.all.id_leas...
<script language="javascript">
function pysjzx_change(){
var leaseObj = document.all.id_lease;
var saleObj = document.all.id_sale;
var hhObj = document.all.id_hh;
var pysjzx_type = document.pysjzxform.pysjzx_type.value;
if (pysjzx_type=="sale"){saleObj.style.display = "block";leaseObj.style.display = "none";}
if (pysjzx_type=="buy"){saleObj.style.display = "block";leaseObj.style.display = "none";}
if (pysjzx_type=="lease"){leaseObj.style.display = "block";saleObj.style.display = "none";}
if (pysjzx_type=="hire"){leaseObj.style.display = "block";saleObj.style.display = "none";}
if (pysjzx_type=="cotenancy"){hhObj.style.display = "block";saleObj.style.display = "none";}
}
请高手详细解答一下这段代码是什么意思 展开
function pysjzx_change(){
var leaseObj = document.all.id_lease;
var saleObj = document.all.id_sale;
var hhObj = document.all.id_hh;
var pysjzx_type = document.pysjzxform.pysjzx_type.value;
if (pysjzx_type=="sale"){saleObj.style.display = "block";leaseObj.style.display = "none";}
if (pysjzx_type=="buy"){saleObj.style.display = "block";leaseObj.style.display = "none";}
if (pysjzx_type=="lease"){leaseObj.style.display = "block";saleObj.style.display = "none";}
if (pysjzx_type=="hire"){leaseObj.style.display = "block";saleObj.style.display = "none";}
if (pysjzx_type=="cotenancy"){hhObj.style.display = "block";saleObj.style.display = "none";}
}
请高手详细解答一下这段代码是什么意思 展开
展开全部
这是一个根据下拉列表的选项来决定显示什么隐藏的函数
<script language="javascript">
function pysjzx_change(){
var leaseObj = document.all.id_lease; //把id为"id_lease"的元素名保存在leaseObj
var saleObj = document.all.id_sale; //把id为"id_sale"的元素名保存在saleObj
var hhObj = document.all.id_hh; //把id为"id_hh"的元素名保存在hhObj
var pysjzx_type = document.pysjzxform.pysjzx_type.value;//这是工作把表单控件pysjzx_type的值保存到Pysjzx_type,估计很有可能是一个下拉列表
//以下是根据Pysjzx_type来决定显示哪个要显示,哪个要隐藏
//style.display="block"为显示,display="none"为隐藏
if (pysjzx_type=="sale"){saleObj.style.display = "block";leaseObj.style.display = "none";}
if (pysjzx_type=="buy"){saleObj.style.display = "block";leaseObj.style.display = "none";}
if (pysjzx_type=="lease"){leaseObj.style.display = "block";saleObj.style.display = "none";}
if (pysjzx_type=="hire"){leaseObj.style.display = "block";saleObj.style.display = "none";}
if (pysjzx_type=="cotenancy"){hhObj.style.display = "block";saleObj.style.display = "none";}
}
}
<script language="javascript">
function pysjzx_change(){
var leaseObj = document.all.id_lease; //把id为"id_lease"的元素名保存在leaseObj
var saleObj = document.all.id_sale; //把id为"id_sale"的元素名保存在saleObj
var hhObj = document.all.id_hh; //把id为"id_hh"的元素名保存在hhObj
var pysjzx_type = document.pysjzxform.pysjzx_type.value;//这是工作把表单控件pysjzx_type的值保存到Pysjzx_type,估计很有可能是一个下拉列表
//以下是根据Pysjzx_type来决定显示哪个要显示,哪个要隐藏
//style.display="block"为显示,display="none"为隐藏
if (pysjzx_type=="sale"){saleObj.style.display = "block";leaseObj.style.display = "none";}
if (pysjzx_type=="buy"){saleObj.style.display = "block";leaseObj.style.display = "none";}
if (pysjzx_type=="lease"){leaseObj.style.display = "block";saleObj.style.display = "none";}
if (pysjzx_type=="hire"){leaseObj.style.display = "block";saleObj.style.display = "none";}
if (pysjzx_type=="cotenancy"){hhObj.style.display = "block";saleObj.style.display = "none";}
}
}
Storm代理
2023-08-29 广告
2023-08-29 广告
"StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,I...
点击进入详情页
本回答由Storm代理提供
展开全部
<脚本语言=“javascript”>功能pysjzx_change() { var leaseobj = document.all.id_lease;VAR saleobj = document.all.id_sale;VAR hhobj = document.all.id_hh;VAR pysjzx_type = document.pysjzxform.pysjzx_type.value;如果(pysjzx_type = =“出售”){ saleobj.style.display =“块”;leaseobj.style.display =“不”;}如果(pysjzx_type = =“购买”){ saleobj.style.display =“块”;leaseobj.style.display =“不”;}如果(pysjzx_type = =“租赁”){ leaseobj.style.display =“块”;saleobj.style.display =“不”;}如果(pysjzx_type = =“雇用”){ leaseobj.style.display =“块”;saleobj.style.display =“不”;}如果(pysjzx_type = =“同居”){ hhobj.style.display =“块”;saleobj.style.display =“不”;}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询