会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
Nice感觉
海绵不断的吸收
博客园
首页
新随笔
联系
订阅
管理
JS控制按钮10秒钟后才能正常使用
设置10秒后按钮显示有效状态
<
script
language
="javascript"
>
function
start()
{
document.getElementById(
"
Button1
"
).disabled
=
true
;
document.getElementById(
"
Button1
"
).value
=
10
;
window.setTimeout(
"
tick()
"
,
1000
);
}
function
tick()
{
var
time
=
new
Number(document.getElementById(
"
Button1
"
).value);
if
(time
>
0
)
{
document.getElementById(
"
Button1
"
).value
=
time
-
1
;
window.setTimeout(
"
tick()
"
,
1000
);
}
else
{
document.getElementById(
"
Button1
"
).disabled
=
false
;
document.getElementById(
"
Button1
"
).value
=
"
保存
"
;
}
}
</
script
>
<
form
>
<
asp:button
id
="Button1"
runat
="server"
Text
="Button"
></
asp:button
>
</
form
>
<
script
language
=javascript
>
start();
</
script
>
posted on
2006-12-19 11:06
Gary.han
阅读(
790
) 评论(
1
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部