会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
专注于 .Net (edobnet)
just do it
博客园
首页
新随笔
联系
订阅
管理
JS循环网页元素,手动触发事件
for
(i
=
0
;i
<
document.all.tags(
"
input
"
).length;i
++
)
{
if
(document.all.tags(
"
input
"
)[i].type
==
"
checkbox
"
)
{
if
(selected
&&
!
document.all.tags(
"
input
"
)[i].checked )
document.all.tags(
"
input
"
)[i].click();
else
if
(
!
selected
&&
document.all.tags(
"
input
"
)[i].checked )
document.all.tags(
"
input
"
)[i].click();
}
}
通过document.all.tags对HTML元素进行选择,这样就可以通过循环遍历到所有自己想找的元素,
posted on
2004-09-02 13:42
edobnet
阅读(
2424
) 评论(
4
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部