<html> <script language="javascript"> var node; var inited=false; var init=function(){ node=document.getElementById("example"); inited=true; } var _check_over=function(){ if(!inited){ return; } node.style.borderStyle="solid"; node.style.borderColor="#FFCC00"; node.style.backgroundColor="#EEEEEE";
this is the hole version<html> <script language="javascript"> var node; var inited=false; var init=function(){ node=document.getElementById("example"); inited=true; } var _check_over=function(){ if(!inited){ return; } node.style.borderStyle="solid"; node.style.borderColor="#FFCC00"; node.style.backgroundColor="#EEEEEE";
} var _check_out=function(){ if(!inited){ return; } node.style.borderStyle=""; node.style.borderColor=""; node.style.backgroundColor="";
} var _check_it=function(){ if(!inited){ return; } if(node.checked){ node.checked=false; }else{ node.checked=true; } }</script><body onload="init()"> <p onmouseover="_check_over()" onmouseout="_check_out()" onclick="_check_it()"> <input type="checkbox" id="example" onmouseover="_check_over()" onmouseout="_check_out()" onclick="_check_it()" /> This is a test! </p> </body> </html>
you can try this. and if you still have problems, send mail to me: [email protected]
but I think you will like this version<html> <script language="javascript"> var node; var inited=false; var init=function(){ node=document.getElementById("example"); inited=true; } var _check_over=function(){ if(!inited){ return; } node.style.borderStyle="solid"; node.style.borderColor="#FFCC00"; node.style.backgroundColor="#EEEEEE"; } var _check_out=function(){ if(!inited){ return; } node.style.borderStyle=""; node.style.borderColor=""; node.style.backgroundColor=""; } var _check_it=function(){ if(!inited){ return; } if(node.checked){ node.checked=false; }else{ node.checked=true; } } </script> <body onload="init()"> <p onmouseover="_check_over()" onmouseout="_check_out(); this.style.cursor='pointer';" onclick="_check_it()"> <input type="checkbox" id="example" onmouseover="_check_over()" onmouseout="_check_out()" onclick="_check_it()" /> This is a test! </p> </body> </html>
purplecalm([email protected]) ( ) 信誉:100 Blog 加为好友 2007-06-14 14:34:44 得分: 0 -------------------------- where are you come from?
hello. I got a new version, I think it is better than above.<html> <script language="javascript"> var node; var inited=false; var init=function(){ node=document.getElementById("example"); inited=true; } var _check_over=function(){ if(!inited){ return; } node.style.borderStyle="solid"; node.style.borderColor="#FFCC00"; node.style.backgroundColor="#EEEEEE"; document.getElementById("test_line").style.display="inline"; document.getElementById("test_line").style.borderBottom="1px solid red"; document.getElementById("test_line").style.cursor="pointer"; } var _check_out=function(){ if(!inited){ return; } node.style.borderStyle=""; node.style.borderColor=""; node.style.backgroundColor=""; document.getElementById("test_line").style.border="0"; } var _check_it=function(){ if(!inited){ return; } if(node.checked){ node.checked=false; }else{ node.checked=true; } }</script><body onload="init()"> <p id="test_line" onmouseover="_check_over();" onmouseout="_check_out()" onclick="_check_it();"> <input type="checkbox" id="example" onmouseover="_check_over()" onmouseout="_check_out()" onclick="_check_it()" /> This is a test! </p> </body> </html>
<script language="javascript"> var node;
var inited=false; var init=function(){
node=document.getElementById("example");
inited=true;
} var _check_over=function(){
if(!inited){
return;
} node.style.borderStyle="solid"; node.style.borderColor="#FFCC00"; node.style.backgroundColor="#EEEEEE";
}
</script>
<body onload="init()">
<input type="checkbox" id="example" onmouseover="_check_over()" />
</body>
</html>
就相当于
我鼠标划过某行的时候这个checkbox获得焦点一样的东西
<script language="javascript"> var node;
var inited=false; var init=function(){
node=document.getElementById("example");
inited=true;
} var _check_over=function(){
if(!inited){
return;
} node.style.borderStyle="solid"; node.style.borderColor="#FFCC00"; node.style.backgroundColor="#EEEEEE";
} var _check_out=function(){
if(!inited){
return;
} node.style.borderStyle=""; node.style.borderColor=""; node.style.backgroundColor="";
} var _check_it=function(){
if(!inited){
return;
}
if(node.checked){
node.checked=false;
}else{
node.checked=true;
}
}</script><body onload="init()">
<p onmouseover="_check_over()" onmouseout="_check_out()" onclick="_check_it()">
<input type="checkbox" id="example" onmouseover="_check_over()" onmouseout="_check_out()" onclick="_check_it()" />
This is a test!
</p>
</body>
</html>
<script language="javascript"> var node;
var inited=false; var init=function(){
node=document.getElementById("example");
inited=true;
} var _check_over=function(){
if(!inited){
return;
}
node.style.borderStyle="solid";
node.style.borderColor="#FFCC00";
node.style.backgroundColor="#EEEEEE";
} var _check_out=function(){
if(!inited){
return;
}
node.style.borderStyle="";
node.style.borderColor="";
node.style.backgroundColor="";
} var _check_it=function(){
if(!inited){
return;
}
if(node.checked){
node.checked=false;
}else{
node.checked=true;
}
}
</script>
<body onload="init()">
<p onmouseover="_check_over()" onmouseout="_check_out(); this.style.cursor='pointer';" onclick="_check_it()">
<input type="checkbox" id="example" onmouseover="_check_over()" onmouseout="_check_out()" onclick="_check_it()" />
This is a test!
</p>
</body>
</html>
--------------------------
where are you come from?
<script language="javascript"> var node;
var inited=false; var init=function(){
node=document.getElementById("example");
inited=true;
} var _check_over=function(){
if(!inited){
return;
}
node.style.borderStyle="solid";
node.style.borderColor="#FFCC00";
node.style.backgroundColor="#EEEEEE";
document.getElementById("test_line").style.display="inline";
document.getElementById("test_line").style.borderBottom="1px solid red";
document.getElementById("test_line").style.cursor="pointer";
} var _check_out=function(){
if(!inited){
return;
}
node.style.borderStyle="";
node.style.borderColor="";
node.style.backgroundColor="";
document.getElementById("test_line").style.border="0";
} var _check_it=function(){
if(!inited){
return;
}
if(node.checked){
node.checked=false;
}else{
node.checked=true;
}
}</script><body onload="init()">
<p id="test_line" onmouseover="_check_over();" onmouseout="_check_out()" onclick="_check_it();">
<input type="checkbox" id="example" onmouseover="_check_over()" onmouseout="_check_out()" onclick="_check_it()" />
This is a test!
</p>
</body>
</html>
<checkbos id="ck1"/><label for="ck1">dddddddddddddd</label>
这样鼠标移动到ddddd上checkbox就有变化了
<input type="checkbox" id="ck1"/><label for="ck1">dddddddddddddd</label>
让tr也有for的效果
不知道可以不可以