zoukankan
html css js c++ java
JS批量添加属性。
<!
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=gb2312"
/>
<
title
>
无标题文档
</
title
>
<
style
>
img
{
}
{
border
:
1px solid #ccc
;
cursor
:
pointer
;
padding
:
4px
;
}
</
style
>
</
head
>
<
body
>
<
div
id
="test"
>
<
img
src
="http://bbs.blueidea.com/images/blue/logo.gif"
alt
="logo"
/>
<
img
src
="http://bbs.blueidea.com/images/blue/logo.gif"
alt
="logo"
/>
<
img
src
="http://bbs.blueidea.com/images/blue/logo.gif"
alt
="logo"
/>
<
img
src
="http://bbs.blueidea.com/images/blue/logo.gif"
alt
="logo"
/>
<
img
src
="http://bbs.blueidea.com/images/blue/logo.gif"
alt
="logo"
/>
<
img
src
="http://bbs.blueidea.com/images/blue/logo.gif"
alt
="logo"
/>
<
img
src
="http://bbs.blueidea.com/images/blue/logo.gif"
alt
="logo"
/>
<
img
src
="http://bbs.blueidea.com/images/blue/logo.gif"
alt
="logo"
/>
<
img
src
="http://bbs.blueidea.com/images/blue/logo.gif"
alt
="logo"
/>
<
img
src
="http://bbs.blueidea.com/images/blue/logo.gif"
alt
="logo"
/>
<
img
src
="http://bbs.blueidea.com/images/blue/logo.gif"
alt
="logo"
/>
</
div
>
</
body
>
<
script
type
="text/javascript"
>
var
imglist
=
document.getElementById(
"
test
"
).getElementsByTagName(
"
img
"
);
for
(
var
i
=
0
;i
<
imglist.length;i
++
)
{
imglist[i].onmouseover
=
function
()
{
this
.style.borderColor
=
"
#f60
"
;
}
imglist[i].onmouseout
=
function
()
{
this
.style.borderColor
=
"
#369
"
;
}
}
</
script
>
</
html
>
查看全文
相关阅读:
FTP工具类
Mac下git用户名密码问题
python3 可能是类似于java的方法重载
Dos窗口默认设置修改
登录接口,密码前端密码加密
编码中存在的问题
在django项目中使用selenium报错:TypeError: environment can only cantain string
python实现:base64与图片的转换
查看电脑支持的文字, .ttf文件
获取指定目录下的所有文件,直到底
原文地址:https://www.cnblogs.com/CB/p/1138961.html
最新文章
工厂方法模式
代理模式
装饰模式
Wireshark补充
参透gRPC
Wire使用手册
Go 进程诊断工具 gops
docker & docker conpose
设计模式
fsnotify监控文件
热门文章
Go+Cobra快速入门
Git生成SSH公钥
Thymeleaf常用标签
SpringBoot定时任务 Service层无法注入问题
JDK8 Lambda
ExcelUtil工具类
HttpClient无乱码
可道云kodexplorer+阿里云架设个人存储
Spring boot集成wsdd配置文件
Jsoup视频信息
Copyright © 2011-2022 走看看