<!--<div class="list">
<!–<input type="radio" id="student" name="role" class="uncheck">
<span class="vir-check"></span>
<label for="student">学生</label>–>
<span class="vir-check uncheck" id="student"></span><label for="student">学生</label>
</div>
<!–专家登录–>
<div class="list">
<!–<input type="radio" id="speciallist" name="role" class="check">
<span class="vir-check"></span>
<label for="speciallist">专家</label>–>
<span class="vir-check uncheck" id="speciallist"></span><label for="speciallist">专家</label>
</div>
<!–学校登录–>
<div class="list">
<!–<input type="radio" id="school" name="role">
<span class="vir-check"><b>√</b></span>
<label for="school">学校</label>–>
<span class="vir-check uncheck" id="school"></span><label for="school">学校</label>
</div>-->
<script type="text/javascript">
/*登录控制*/
var checks = document.getElementsByClassName('vir-check');
var len = checks.length;
var panel = document.getElementsByTagName('label');
var form = document.getElementsByTagName('form')[0];
var button = document.getElementById('login');
var action1 = 'index.html';
var action2 = 'login.html';
var action3 = 'register.html';
for(var j = 0;j<len;j++){
checks[j].onclick = function(){
if (this.innerHTML==""){
//去掉其他项的勾选
for(var h =0 ; h<len;h++){
checks[h].innerHTML = "";
}
//把本项目的设为勾选
this.innerHTML = "√";
}
}
}
for(var k = 0;k < len;k++){
panel[k].onclick =function(){
if (this.previousElementSibling.innerHTML == ""){
//置空所有
for(var l = 0; l<len ;l++){
checks[l].innerHTML = "";
}
//选择相关项
this.previousElementSibling.innerHTML = "√";
/*修改跳转路径*/
}
}
}
button.onclick = function(){
for(var f = 0;f<len;f++){
if(checks[f].innerHTML=='√'){
if(f==0){
form.setAttribute('action',action1);
}else if(f==1){
form.setAttribute('action',action2);
}else{
form.setAttribute('action',action3);
}
form.submit();
}
}
/*
switch(f){
case 0:
form.submit();
break;
case 1:
form.submit();
break;
case 2:
break;
default:
console.log("没有弄对");
}*/
}
</script>