资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
解决function函数内的循环变量
<!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=utf-8" /> <style type="text/css"> ul{border:1px solid red; width:300px} li{height:40px; margin:5px; background-color:#CCCCCC} </style> <title>无标题文档</title> </head> <body> <ul> <li>1111111111</li> <li>22222222222</li> <li>3333333333333</li> <li>44444444444</li> <li>55555555555</li> </ul> </body> </html> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20type%3D%22text%2Fjavascript%22%3E%20%0D%0Awindow.onload%20%3D%20function()%7B%20%0D%0A%20%20%20%20var%20li_o%20%3D%20document.getElementsByTagName(%22li%22)%3B%20%0D%0A%20%20%20%20for(var%20i%3D0%3Bi%3Cli_o.length%3Bi%2B%2B)%20%7B%20%0D%0A%20%20%20%20%20%20%20%20li_o%5Bi%5D%5B'i'%5D%20%3D%20i%3B%20%0D%0A%20%20%20%20%20%20%20%20li_o%5Bi%5D.onmouseover%20%3D%20function()%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20alert(%22%E7%9C%8B%E7%9C%8B%E7%8E%B0%E5%9C%A8%E5%BC%B9%E5%87%BA%E7%9A%84%E6%98%AF%E5%87%A0%22%2Bthis%5B%22i%22%5D)%3B%20%0D%0A%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%7D%20%0D%0A%7D%20%0D%0A%3C%2Fscript%3E">
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程