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
>
查看全文
相关阅读:
Eclipse安装代码反编译插件Enhanced Class Decompiler
使用idea创建web项目
shell编程学习笔记(十二):Shell中的break/continue跳出循环
shell编程学习笔记(十一):Shell中的while/until循环
windows环境下安装zookeeper(仅本地使用)
解决base64-encoded secret key cannot be null or empty问题
不就一个上传图片功能吗,为什么要搞得那么复杂?
解决WARN警告:Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended
Jmeter发送jdbc请求(操作mysql)
Jmeter-ForEach控制器
原文地址:https://www.cnblogs.com/CB/p/1138961.html
最新文章
celery --分布式任务队列
Linux Shell 运算符
Linux Shell 变量
python 模块学习
python itertools 模块讲解
python 解析json讲解(demjson)
Django项目中自定义manage命令
mac 中登陆mysql忘记密码解决办法
IE 下js里面new Date("2017-07-11 08:00:00") 出现NAN的问题以及解决方法
hadoop的eclipse插件
热门文章
mysql5.5安装到最后一步卡死无响应的解决方法
Hbase各版本支持情况
Comparable接口的使用
css3实现动画效果
HTML5中使用EventSource实现服务器发送事件
HTML5中的Web Worker技术
css3中的盒子模型
使用visual studio code运行html
【转】解决chrome浏览器不支持audio和video标签的autoplay自动播放
spring mvc中添加对Thymeleaf的支持
Copyright © 2011-2022 走看看