首页 > 代码库 > 点击弹出序列号-JS

点击弹出序列号-JS

效果展示:

技术分享

技术分享

代码如下:

技术分享
@{    Layout = null;}<!DOCTYPE html><html><head>    <meta name="viewport" content="width=device-width" />    <title>Index2</title></head><body>    <div>        <ul id="ul1">            <li>1111111111111111</li>            <li>2222222222222222</li>            <li>3333333333333333</li>        </ul>    </div></body></html><script src=http://www.mamicode.com/"~/Scripts/jquery-1.8.2.min.js"></script><script>    var li = document.getElementsByTagName("li");    for (var i = 0; i < li.length; i++) {      (function (e) {          li[e].onclick = function () {              alert(e);              alert(li[e].innerHTML);          }      })(i)          }</script>
View Code

 

点击弹出序列号-JS