<div class="codetitle"> <span><a style="CURSOR: pointer" data="46169" class="copybut" id="copybut46169" onclick="doCopy('code46169')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code46169"> <br><script language="javascript" type="text/javascript"> <br><br>var Arrchange1 =new Array (); <BR>var Arrchange2 =new Array (); <BR>var Arrchange3 =new Array (); <BR>function hide(s_id,index) <BR>{ <BR>var xxx = document .getElementById (s_id); <BR>var oldOption = xxx.children(index); <BR>var oldStr = oldOption.innerText; <BR>var newOption = document.createElement('<div' + oldOption.outerHTML.match(/(<\w*)([^>]*)(>)/)[2] +'>'); <BR>newOption.innerText= oldStr; <BR>newOption.swapNode(oldOption); <BR>//alert(xxx.innerHTML); <BR>} <br><br>function show(s_id,index) <BR>{ <BR>var xxx =document .getElementById (s_id); <BR>var oldOption = xxx.children(index); <BR>if(oldOption.tagName=='DIV') <BR>{ <BR>var oldStr = oldOption.innerText; <BR>var newOption = document.createElement('<option' + oldOption.outerHTML.match(/(<\w*)([^>]*)(>)/)[2] +'>'); <BR>newOption.innerText = oldStr; <BR>newOption.swapNode(oldOption); <BR>} <BR>//alert(xxx.innerHTML); <BR>} <br><br><br><br>function onchange1() <BR>{ <BR>var s_index=document .getElementById ("Ddl_question1").options[document .getElementById ("Ddl_question1").selectedIndex].value; <BR>s_index = parseInt(s_index); <BR>if(s_index ==0) <BR>{ <BR>show ('Ddl_question2',Arrchange1 [0] ); <BR>show ('Ddl_question3',Arrchange1 [0] ); <BR>Arrchange1.pop(); <BR>} <BR>else <BR>{ <BR>Arrchange1.push(s_index); <BR>if(Arrchange1.length>0) <BR>{ <BR>show ('Ddl_question2',Arrchange1 [0] ); <BR>} <BR>if(Arrchange1.length>0) <BR>{ <BR>show ('Ddl_question3',Arrchange1 [0] ); <BR>} <BR>hide('Ddl_question2',s_index); <BR>hide('Ddl_question3',s_index); <BR>} <BR>} <BR>function onchange2() <BR>{ <BR>var s_index=document .getElementById ("Ddl_question2").options[document .getElementById ("Ddl_question2").selectedIndex].value; <BR>s_index = parseInt(s_index); <BR>if(s_index ==0) <BR>{ <BR>show ('Ddl_question1',Arrchange1 [0] ); <BR>show ('Ddl_question3',Arrchange3 [0] ); <BR>Arrchange2.pop(); <BR>} <BR>else <BR>{ <BR>Arrchange2.push(s_index); <BR>if(Arrchange2.length>0) <BR>{ <BR>show ('Ddl_question1',Arrchange2 [0] ); <BR>} <BR>if(Arrchange2.length>0) <BR>{ <BR>show ('Ddl_question3',Arrchange2 [0] ); <BR>} <BR>hide('Ddl_question1',s_index); <BR>hide('Ddl_question3',s_index); <BR>} <BR>} <BR>function onchange3() <BR>{ <BR>var s_index=document .getElementById ("Ddl_question3").options[document .getElementById ("Ddl_question3").selectedIndex].value; <BR>s_index = parseInt(s_index); <BR>if(s_index ==0) <BR>{ <BR>show ('Ddl_question1',Arrchange3 [0] ); <BR>show ('Ddl_question2',Arrchange3 [0] ); <BR>Arrchange3.pop(); <BR>} <BR>else <BR>{ <BR>Arrchange3.push(s_index); <BR>if(Arrchange1.length>0) <BR>{ <BR>show ('Ddl_question1',Arrchange3 [0] ); <BR>} <BR>if(Arrchange2.length>0) <BR>{ <BR>show ('Ddl_question2',Arrchange3 [0] ); <BR>} <BR>hide('Ddl_question1',s_index); <BR>hide('Ddl_question2',s_index); <BR>} <BR>} <br><br>function a() {alert("fuck ");} <BR></script> <br><br><select name="Ddl_question1" id="Ddl_question1" onchange="onchange1()"> <br><option value="0">请选择密保信息</option> <br><option value="1">您母亲的姓名是?</option> <br><option value="2">您父亲的姓名是?</option> <br><option value="3">您配偶的姓名是?</option> <br><option value="4">您的出生地是?</option> <br><option value="5">您高中班主任的姓名是?</option> <br><option value="6">您初中班主任的姓名是?</option> <br><option value="7">您小学班主任的姓名是?</option> <br><option value="8">您小学校名是?</option> <br><option value="9">您的学号(或工号)是?</option> <br><option value="10">您父亲的生日是?</option> <br><option value="11">您母亲的生日是?</option> <br><option value="12">您配偶的生日是?</option> <br><br></select> <br><select name="Ddl_question2" id="Ddl_question2" onchange="onchange2()"> <br><option value="0">请选择密保信息</option> <br><option value="1">您母亲的姓名是?</option> <br><option value="2">您父亲的姓名是?</option> <br><option value="3">您配偶的姓名是?</option> <br><option value="4">您的出生地是?</option> <br><option value="5">您高中班主任的姓名是?</option> <br><option value="6">您初中班主任的姓名是?</option> <br><option value="7">您小学班主任的姓名是?</option> <br><option value="8">您小学校名是?</option> <br><option value="9">您的学号(或工号)是?</option> <br><option value="10">您父亲的生日是?</option> <br><option value="11">您母亲的生日是?</option> <br><option value="12">您配偶的生日是?</option> <br><br></select> <br><select name="Ddl_question3" id="Ddl_question3" onchange="onchange3()"> <br><option value="0">请选择密保信息</option> <br><option value="1">您母亲的姓名是?</option> <br><option value="2">您父亲的姓名是?</option> <br><option value="3">您配偶的姓名是?</option> <br><option value="4">您的出生地是?</option> <br><option value="5">您高中班主任的姓名是?</option> <br><option value="6">您初中班主任的姓名是?</option> <br><option value="7">您小学班主任的姓名是?</option> <br><option value="8">您小学校名是?</option> <br><option value="9">您的学号(或工号)是?</option> <br><option value="10">您父亲的生日是?</option> <br><option value="11">您母亲的生日是?</option> <br><option value="12">您配偶的生日是?</option> <br><br></select> <br> </div>