<html>
<script>
function setvalue(x)
{
var value=document.getElementById("lb"+x).title;
var hd11=document.getElementById("ksks").value;
hd11=value;
//document.getElementById("btn").value=hd11;
for(i=1;i<5;i++){
if(i==x){
document.getElementById("lb"+x).style.backgroundColor="red";
}else
{
document.getElementById("lb"+i).style.backgroundColor="";
}
}
document.getElementById("ksks").value=hd11;
}
function ok()
{
alert(document.getElementById("ksks").value);
document.getElementById("btn").value=document.getElementById("ksks").value;
}
</script>
<form name="form1" action="" method="post">
<div name="c_hot_tad_login">
<p>年级
<div class="pi_content">
<label id="lb1" title="1" onClick="setvalue(1)" >12311111</label>
</div>
<div class="pi_content">
<label id="lb2" title="2" onClick="setvalue(2)">22222</label>
</div>
<div class="pi_content">
<label id="lb3" title="3" onClick="setvalue(3)">33333</label>
</div>
<div class="pi_content">
<label id="lb4" title="4" onClick="setvalue(4)">44444</label>
</div>
<input type="text" id="ksks" value="" >
<input type="button" value="" size="15px" id="btn" onClick=" ok()"/></div>
</form>
</html>
<script>
function setvalue(x)
{
var value=document.getElementById("lb"+x).title;
var hd11=document.getElementById("ksks").value;
hd11=value;
//document.getElementById("btn").value=hd11;
for(i=1;i<5;i++){
if(i==x){
document.getElementById("lb"+x).style.backgroundColor="red";
}else
{
document.getElementById("lb"+i).style.backgroundColor="";
}
}
document.getElementById("ksks").value=hd11;
}
function ok()
{
alert(document.getElementById("ksks").value);
document.getElementById("btn").value=document.getElementById("ksks").value;
}
</script>
<form name="form1" action="" method="post">
<div name="c_hot_tad_login">
<p>年级
<div class="pi_content">
<label id="lb1" title="1" onClick="setvalue(1)" >12311111</label>
</div>
<div class="pi_content">
<label id="lb2" title="2" onClick="setvalue(2)">22222</label>
</div>
<div class="pi_content">
<label id="lb3" title="3" onClick="setvalue(3)">33333</label>
</div>
<div class="pi_content">
<label id="lb4" title="4" onClick="setvalue(4)">44444</label>
</div>
<input type="text" id="ksks" value="" >
<input type="button" value="" size="15px" id="btn" onClick=" ok()"/></div>
</form>
</html>