晕了 自己想出来了
差了一个a=x;加上后2者是一样的 晕 <script>
var a;
function test(x){
x.disabled=true;
try {
a.disabled = false;
a=x;
}catch(e){
a=x
}
}
</script>
<input type="button" id="button1" value="button1" onclick="test(this);">
<input type="button" id="button2" value="button2" onclick="test(this);">
<input type="button" id="button3" value="button3" onclick="test(this);">
<input type="button" id="button1" value="button4" onclick="test(this);">
<input type="button" id="button2" value="button5" onclick="test(this);">
差了一个a=x;加上后2者是一样的 晕 <script>
var a;
function test(x){
x.disabled=true;
try {
a.disabled = false;
a=x;
}catch(e){
a=x
}
}
</script>
<input type="button" id="button1" value="button1" onclick="test(this);">
<input type="button" id="button2" value="button2" onclick="test(this);">
<input type="button" id="button3" value="button3" onclick="test(this);">
<input type="button" id="button1" value="button4" onclick="test(this);">
<input type="button" id="button2" value="button5" onclick="test(this);">
a=x;
============================================
这注释是谁写的?拖出去砍了!
function test(x)
{
x.disabled=true;
if ( 'undefined'!=typeof(a.disabled))
a.disabled=false;
a=x;
}
var a,b;
function test(x){
x.disabled=true;
b=x;
a.disabled=false;//如果不加if(a) 下面的a=x将永远得不到执行
a=x;
}
window.onerror=function(){
a=b;
}
</script>
<input type="button" id="button1" value="button1" onclick="test(this);">
<input type="button" id="button2" value="button2" onclick="test(this);">
<input type="button" id="button3" value="button3" onclick="test(this);">
<input type="button" id="button1" value="button4" onclick="test(this);">
<input type="button" id="button2" value="button5" onclick="test(this);">
var a,b;
function test(x){
x.disabled=true;
b=x;
a.disabled=false;//如果不加if(a) 下面的a=x将永远得不到执行
a=x;
}
window.onerror=function(){//不要把onerror函数放到test函数中 会失效
a=b;
}
</script>
<input type="button" id="button1" value="button1" onclick="test(this);">
<input type="button" id="button2" value="button2" onclick="test(this);">
<input type="button" id="button3" value="button3" onclick="test(this);">
<input type="button" id="button1" value="button4" onclick="test(this);">
<input type="button" id="button2" value="button5" onclick="test(this);">