js问题 jscsdn 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">#show{ position:fixed; background-color:#333; opacity:.5; filter:alpha(opacity=50); width:100%; height:100%; top:0px; left:0px; padding:200px; display:none;}</style><script type="text/javascript">function change(buttons,next,len,show){ show.style.display='block'; for(var i=0;i<len-1;i++){ buttons[i].onclick=function(){ next.value=this.value; show.style.display='none'; } } buttons[i].onclick=function(){ next.value=''; show.style.display='none'; }}function init(){ var table=document.getElementById("do"); var show=document.getElementById("show"); var buttons=show.getElementsByTagName("input"); var len=buttons.length; table.onclick=function(e){ var a=e||window.event; var src=a.srcElement||a.target; if(src.type=='button'){ var next=src.parentNode.nextSibling; while(!next.tagName){ next=next.nextSibling; } next=next.firstChild; if(next.value){ for(var i=0;i<len-1;i++){ buttons[i].disabled=true; } buttons[i].disabled=false; }else{ for(var i=0;i<len-1;i++){ buttons[i].disabled=false; } buttons[i].disabled=true; } change(buttons,next,len,show); } }}window.onload=init;</script></head><body><table id="do"> <tr> <td><input type="button" value="one"></td> <td><input type="text"></td> </tr> <tr> <td><input type="button" value="two"></td> <td><input type="text"></td> </tr> <tr> <td><input type="button" value="three"></td> <td><input type="text"></td> </tr></table><div id="show"> <table> <tr> <td><input type="button" value="1"></td> <td><input type="button" value="2"></td> <td><input type="button" value="3"></td> <td><input type="button" value="4"></td> <td><input type="button" value="5"></td> </tr> <tr> <td><input type="button" value="6"></td> <td><input type="button" value="7"></td> <td><input type="button" value="8"></td> <td><input type="button" value="9"></td> <td><input type="button" value="x"></td> </tr> </table></div></body></html>类似这样试试 我这段文字滚动效果始终做不出啊,试了很多方式都没用,求助各位大侠了,在线等 为什么我第2次双击图片变不回来,请高手指点 树形控件显示不出来,求高人指教,在线跪求急等 ?????????????????????? 请教怎样如实显示代码 怎样用javascript将页面内的一组checkbox实现只能选一个的情况? [help]163邮箱的特效 如何使用图片实现复选框的全选择? jquery 变量值是中文,输出到HTML是乱码。急 求帮助这个鼠标经过事件怎么写 我用jquery查询aspx生成的json,为什么一直失败呢? js获取easyui datagrid中的数据,并拼接成json
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
#show{
position:fixed;
background-color:#333;
opacity:.5;
filter:alpha(opacity=50);
width:100%;
height:100%;
top:0px;
left:0px;
padding:200px;
display:none;
}
</style>
<script type="text/javascript">
function change(buttons,next,len,show){
show.style.display='block';
for(var i=0;i<len-1;i++){
buttons[i].onclick=function(){
next.value=this.value;
show.style.display='none';
}
}
buttons[i].onclick=function(){
next.value='';
show.style.display='none';
}
}
function init(){
var table=document.getElementById("do");
var show=document.getElementById("show");
var buttons=show.getElementsByTagName("input");
var len=buttons.length;
table.onclick=function(e){
var a=e||window.event;
var src=a.srcElement||a.target;
if(src.type=='button'){
var next=src.parentNode.nextSibling;
while(!next.tagName){
next=next.nextSibling;
}
next=next.firstChild;
if(next.value){
for(var i=0;i<len-1;i++){
buttons[i].disabled=true;
}
buttons[i].disabled=false;
}else{
for(var i=0;i<len-1;i++){
buttons[i].disabled=false;
}
buttons[i].disabled=true;
}
change(buttons,next,len,show);
}
}
}
window.onload=init;
</script>
</head><body>
<table id="do">
<tr>
<td><input type="button" value="one"></td>
<td><input type="text"></td>
</tr>
<tr>
<td><input type="button" value="two"></td>
<td><input type="text"></td>
</tr>
<tr>
<td><input type="button" value="three"></td>
<td><input type="text"></td>
</tr>
</table>
<div id="show">
<table>
<tr>
<td><input type="button" value="1"></td>
<td><input type="button" value="2"></td>
<td><input type="button" value="3"></td>
<td><input type="button" value="4"></td>
<td><input type="button" value="5"></td>
</tr>
<tr>
<td><input type="button" value="6"></td>
<td><input type="button" value="7"></td>
<td><input type="button" value="8"></td>
<td><input type="button" value="9"></td>
<td><input type="button" value="x"></td>
</tr>
</table>
</div>
</body>
</html>
类似这样试试